@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ─── Variables ─────────────────────────────────────────────────────────────── */
:root {
  --bg:       #070b18;
  --bg2:      #0d1424;
  --cyan:     #38bdf8;
  --indigo:   #818cf8;
  --green:    #34d399;
  --orange:   #fb923c;
  --red:      #f87171;
  --yellow:   #fbbf24;
  --text:     #e2e8f0;
  --muted:    #94a3b8;
  --glass-bg: rgba(255,255,255,.04);
  --glass-bd: rgba(255,255,255,.10);
  --radius:   14px;
  --shadow:   0 4px 24px rgba(0,0,0,.35);
}

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

html, body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Navigation client ───────────────────────────────────────────────────── */
.client-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 32px;
  height: 60px;
  background: rgba(9,14,27,.96);
  border-bottom: 1px solid var(--glass-bd);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
}

.nav-brand img { height: 36px; display: block; }

.nav-welcome {
  flex: 1;
  font-size: .9rem;
  color: var(--muted);
}
.nav-welcome strong { color: var(--text); font-weight: 600; }

.nav-actions { display: flex; align-items: center; gap: 12px; }

.nav-site-link {
  font-size: .8rem;
  color: var(--muted);
  transition: color .2s;
}
.nav-site-link:hover { color: var(--cyan); text-decoration: none; }

.btn-logout {
  padding: 7px 15px;
  background: rgba(248,113,113,.1);
  border: 1px solid rgba(248,113,113,.22);
  border-radius: 8px;
  color: var(--red);
  font-size: .8rem;
  font-weight: 500;
  transition: all .2s;
}
.btn-logout:hover { background: rgba(248,113,113,.2); text-decoration: none; }

/* ─── Bouton avatar nav ───────────────────────────────────────────────────── */
.nav-avatar-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 2px solid rgba(56,189,248,.3);
  background: rgba(56,189,248,.1);
  cursor: pointer;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .2s, box-shadow .2s;
  flex-shrink: 0;
}
.nav-avatar-btn:hover { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(56,189,248,.15); }
.nav-avatar-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nav-avatar-initials { font-size: .82rem; font-weight: 700; color: var(--cyan); line-height: 1; }

/* ─── Modal overlay (profil + autres) ────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  width: 100%; max-height: 92vh; overflow-y: auto;
  animation: modalIn .2s ease;
}
@keyframes modalIn { from { opacity:0; transform:scale(.96) translateY(8px) } to { opacity:1; transform:none } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.modal-header h2 { font-size: 1.1rem; font-weight: 700; }
.modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 1.1rem; line-height: 1;
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  border-radius: 6px; transition: background .2s, color .2s;
}
.modal-close:hover { background: rgba(255,255,255,.08); color: var(--text); }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  margin-top: 20px; padding-top: 16px;
  border-top: 1px solid var(--glass-bd);
}

/* ─── Avatar modal profil ─────────────────────────────────────────────────── */
.profile-avatar-wrap {
  width: 84px; height: 84px;
  border-radius: 50%;
  border: 3px solid rgba(56,189,248,.3);
  overflow: hidden;
  flex-shrink: 0;
}
.profile-avatar-img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-placeholder {
  width: 100%; height: 100%;
  background: rgba(56,189,248,.14);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 800; color: var(--cyan);
}

/* ─── Champs formulaire (modal) ───────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: .8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.field input, .field select, .field textarea {
  background: rgba(255,255,255,.05);
  border: 1px solid var(--glass-bd);
  border-radius: 9px;
  color: var(--text);
  font-size: .9rem;
  padding: 10px 14px;
  font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
  width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: rgba(56,189,248,.5);
  box-shadow: 0 0 0 3px rgba(56,189,248,.08);
}

/* ─── Layout principal ────────────────────────────────────────────────────── */
.client-main {
  max-width: 920px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* ─── Page header ─────────────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 12px;
  flex-wrap: wrap;
}
.page-header h1 { font-size: 1.55rem; font-weight: 800; letter-spacing: -.02em; }

/* ─── Cards ───────────────────────────────────────────────────────────────── */
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-bd);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  backdrop-filter: blur(14px);
  animation: fadeInUp .3s ease both;
}
.glass-card h2 { font-size: 1rem; font-weight: 700; margin-bottom: 16px; }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}

/* ─── Projet card ─────────────────────────────────────────────────────────── */
.project-card {
  background: linear-gradient(135deg, rgba(56,189,248,.05), rgba(129,140,248,.05));
  border-color: rgba(56,189,248,.18);
}
.project-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.project-header h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 8px; }
.project-statut { flex-shrink: 0; }

/* ─── Barre de progression projet ────────────────────────────────────────── */
.project-progress { margin-top: 20px; }
.progress-steps {
  display: flex;
  align-items: flex-start;
  position: relative;
  padding-top: 4px;
}

/* Ligne de fond (grise) */
.step-track {
  position: absolute;
  top: 19px; /* centre du dot (30px / 2 + 4px padding-top) */
  left: 15px; right: 15px; /* ne commence/finit pas aux bords extrêmes */
  height: 2px;
  background: rgba(255,255,255,.08);
  z-index: 0;
  border-radius: 2px;
}

/* Ligne de progression (colorée) */
.step-track-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--indigo));
  border-radius: 2px;
  transition: width 1.2s ease;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
  z-index: 2; /* au-dessus de la ligne */
}

/* Fond solide = la ligne ne passe plus à travers */
.step-dot {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--bg2);          /* fond opaque couleur page */
  border: 2px solid rgba(255,255,255,.16);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  color: var(--muted);
  transition: all .4s ease;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}
.step-dot svg { width: 14px; height: 14px; }

.progress-step.done .step-dot {
  background: var(--bg2);
  border-color: var(--green);
  color: var(--green);
  box-shadow: 0 0 0 3px rgba(52,211,153,.12);
}
.progress-step.active .step-dot {
  background: var(--bg2);
  border-color: var(--cyan);
  border-width: 2.5px;
  color: var(--cyan);
  box-shadow: 0 0 0 4px rgba(56,189,248,.12), 0 0 14px rgba(56,189,248,.25);
}
.step-label {
  font-size: .68rem;
  color: var(--muted);
  margin-top: 8px;
  text-align: center;
  white-space: normal;
  word-break: keep-all;
  max-width: 60px;
  font-weight: 500;
}
.progress-step.done .step-label { color: var(--green); }
.progress-step.active .step-label { color: var(--cyan); font-weight: 600; }

/* ─── Stat cards ──────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-bd);
  border-radius: var(--radius);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  animation: fadeInUp .3s ease both;
  transition: transform .2s;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-card:nth-child(2) { animation-delay: .06s; }
.stat-card:nth-child(3) { animation-delay: .12s; }

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
}
.stat-card.cyan::before   { background: linear-gradient(90deg, var(--cyan), var(--indigo)); }
.stat-card.green::before  { background: linear-gradient(90deg, var(--green), #059669); }
.stat-card.orange::before { background: linear-gradient(90deg, var(--orange), #d97706); }

.stat-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.stat-icon {
  width: 34px; height: 34px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
}
.stat-icon svg { width: 17px; height: 17px; }
.stat-card.cyan   .stat-icon { background: rgba(56,189,248,.13);  color: var(--cyan); }
.stat-card.green  .stat-icon { background: rgba(52,211,153,.13);  color: var(--green); }
.stat-card.orange .stat-icon { background: rgba(251,146,60,.13);  color: var(--orange); }

.stat-label { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.stat-value { font-size: 1.65rem; font-weight: 800; }
.stat-card.cyan   .stat-value { color: var(--cyan); }
.stat-card.green  .stat-value { color: var(--green); }
.stat-card.orange .stat-value { color: var(--orange); }

/* ─── Liste demandes ──────────────────────────────────────────────────────── */
.demandes-list { display: flex; flex-direction: column; gap: 10px; }

.demande-item {
  background: rgba(255,255,255,.025);
  border: 1px solid var(--glass-bd);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color .2s;
}
.demande-item:hover { border-color: rgba(56,189,248,.28); }
.demande-item.en_attente { border-left: 3px solid var(--cyan); }
.demande-item.vue        { border-left: 3px solid var(--indigo); }
.demande-item.en_cours   { border-left: 3px solid var(--orange); }
.demande-item.terminee   { border-left: 3px solid var(--green); }
.demande-item.refusee    { border-left: 3px solid var(--red); }

.demande-summary {
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
}
.demande-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  flex-wrap: wrap;
}
.demande-titre { font-weight: 600; font-size: .93rem; }

.demande-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.demande-desc-preview {
  font-size: .84rem;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.demande-toggle-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .76rem;
  color: var(--cyan);
  margin-top: 6px;
  font-weight: 500;
}
.demande-toggle-btn svg {
  width: 13px; height: 13px;
  transition: transform .25s ease;
}
.demande-toggle-btn.open svg { transform: rotate(180deg); }

.demande-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s ease;
  border-top: 0 solid var(--glass-bd);
}
.demande-body.expanded {
  max-height: 600px;
  border-top-width: 1px;
}
.demande-body-inner {
  padding: 14px 18px;
}
.demande-full-desc {
  font-size: .875rem;
  color: var(--muted);
  line-height: 1.65;
  white-space: pre-wrap;
  margin-bottom: 12px;
}
.demande-reponse {
  padding: 12px 14px;
  background: rgba(52,211,153,.06);
  border: 1px solid rgba(52,211,153,.2);
  border-radius: 9px;
  color: var(--text);
}
.demande-reponse-label {
  font-size: .72rem;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .06em;
  display: flex;
  align-items: center;
  gap: 5px;
}
.demande-reponse-text { font-size: .875rem; line-height: 1.6; white-space: pre-wrap; }

/* ─── Badges ──────────────────────────────────────────────────────────────── */
.badge-status {
  padding: 3px 11px;
  border-radius: 20px;
  font-size: .74rem;
  font-weight: 600;
  white-space: nowrap;
  display: inline-block;
}
.badge-status.prospect  { background: rgba(251,191,36,.14);  color: var(--yellow); }
.badge-status.en_cours  { background: rgba(56,189,248,.14);  color: var(--cyan); }
.badge-status.termine   { background: rgba(129,140,248,.14); color: var(--indigo); }
.badge-status.paye      { background: rgba(52,211,153,.14);  color: var(--green); }
.badge-status.annule    { background: rgba(248,113,113,.14); color: var(--red); }
.badge-status.cyan      { background: rgba(56,189,248,.14);  color: var(--cyan); }
.badge-status.en_attente { background: rgba(56,189,248,.14); color: var(--cyan); }
.badge-status.terminee  { background: rgba(52,211,153,.14);  color: var(--green); }
.badge-status.refusee   { background: rgba(248,113,113,.14); color: var(--red); }
.badge-status.vue       { background: rgba(129,140,248,.14); color: var(--indigo); }

.badge-cat {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .74rem;
  background: rgba(251,146,60,.12);
  color: var(--orange);
  display: inline-block;
}

.badge-priority {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .73rem;
  font-weight: 600;
  display: inline-block;
}
.badge-priority.normale  { background: rgba(148,163,184,.1);  color: var(--muted); }
.badge-priority.haute    { background: rgba(251,146,60,.14);  color: var(--orange); }
.badge-priority.urgente  { background: rgba(248,113,113,.14); color: var(--red); }

/* ─── Type selector (nouvelle demande) ────────────────────────────────────── */
.type-selector {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
.type-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 10px 12px;
  background: var(--glass-bg);
  border: 2px solid var(--glass-bd);
  border-radius: 12px;
  cursor: pointer;
  transition: all .2s ease;
  text-align: center;
}
.type-option:hover {
  border-color: rgba(56,189,248,.35);
  background: rgba(56,189,248,.05);
}
.type-option.selected {
  border-color: var(--cyan);
  background: rgba(56,189,248,.1);
  box-shadow: 0 0 0 3px rgba(56,189,248,.1);
}
.type-option input[type="radio"] { display: none; }
.type-icon { font-size: 1.5rem; line-height: 1; }
.type-label { font-size: .75rem; color: var(--muted); font-weight: 500; line-height: 1.2; }
.type-option.selected .type-label { color: var(--cyan); font-weight: 600; }

/* ─── Priority selector ───────────────────────────────────────────────────── */
.priority-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.priority-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--glass-bg);
  border: 2px solid var(--glass-bd);
  border-radius: 10px;
  cursor: pointer;
  font-size: .875rem;
  font-weight: 500;
  transition: all .18s;
}
.priority-option input[type="radio"] { display: none; }
.priority-icon { font-size: 1.1rem; }
.priority-option.selected.normale {
  border-color: rgba(148,163,184,.5);
  background: rgba(148,163,184,.07);
  color: var(--text);
}
.priority-option.selected.haute {
  border-color: var(--orange);
  background: rgba(251,146,60,.08);
  color: var(--orange);
}
.priority-option.selected.urgente {
  border-color: var(--red);
  background: rgba(248,113,113,.08);
  color: var(--red);
}

/* ─── Character counter ───────────────────────────────────────────────────── */
.char-counter {
  display: flex;
  justify-content: flex-end;
  font-size: .74rem;
  color: var(--muted);
  margin-top: 4px;
  transition: color .2s;
}
.char-counter.min-reached { color: var(--green); }
.char-counter.warning { color: var(--orange); }
.char-counter.over    { color: var(--red); }

/* ─── Formulaires ─────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 16px; }
.field label { font-size: .8rem; color: var(--muted); font-weight: 600; }
.field input, .field select, .field textarea {
  padding: 10px 14px;
  background: rgba(255,255,255,.055);
  border: 1px solid var(--glass-bd);
  border-radius: 9px;
  color: var(--text);
  font-size: .9rem;
  font-family: inherit;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  resize: vertical;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(56,189,248,.1);
}

select option { background: #0d1424; color: #e2e8f0; }

.field-hint { font-size: .75rem; color: var(--muted); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-row .field { margin-bottom: 0; }

/* ─── Boutons ─────────────────────────────────────────────────────────────── */
.btn-primary {
  padding: 10px 22px;
  background: linear-gradient(135deg, var(--cyan), var(--indigo));
  border: none;
  border-radius: 9px;
  color: #fff;
  font-size: .9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
}
.btn-primary:hover {
  opacity: .9;
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(56,189,248,.22);
  text-decoration: none;
}
.btn-primary.full-width { width: 100%; justify-content: center; padding: 13px; font-size: 1rem; }

.btn-ghost {
  padding: 10px 20px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-bd);
  border-radius: 9px;
  color: var(--muted);
  font-size: .88rem;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all .2s;
}
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); text-decoration: none; }

/* ─── Empty state ─────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.empty-state-icon {
  width: 60px; height: 60px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-bd);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}
.empty-state-title { font-size: 1.05rem; font-weight: 700; }
.empty-state-text  { font-size: .875rem; color: var(--muted); max-width: 320px; }

/* ─── Alerts ──────────────────────────────────────────────────────────────── */
.alert {
  padding: 12px 18px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: .88rem;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: fadeInUp .3s ease;
}
.alert-success { background: rgba(52,211,153,.1);  border: 1px solid rgba(52,211,153,.28); color: #6ee7b7; }
.alert-error   { background: rgba(248,113,113,.1); border: 1px solid rgba(248,113,113,.28); color: #fca5a5; }

/* ─── Login page ──────────────────────────────────────────────────────────── */
.login-page {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(56,189,248,.12), transparent),
    var(--bg);
}
.login-wrap { width: 100%; max-width: 400px; }
.login-card { text-align: center; padding: 40px; }
.login-logo img { height: 68px; margin-bottom: 22px; }
.login-card h1 { font-size: 1.5rem; font-weight: 800; margin-bottom: 6px; }
.login-sub { color: var(--muted); font-size: .88rem; margin-bottom: 28px; }
.login-card .field { text-align: left; }

/* ─── Bouton "Voir mon site" ──────────────────────────────────────────────── */
.btn-voir-site {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: linear-gradient(135deg, rgba(56,189,248,.14), rgba(129,140,248,.10));
  border: 1px solid rgba(56,189,248,.28);
  border-radius: 20px;
  color: var(--cyan);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all .2s ease;
  white-space: nowrap;
}
.btn-voir-site:hover {
  background: linear-gradient(135deg, rgba(56,189,248,.24), rgba(129,140,248,.18));
  border-color: rgba(56,189,248,.5);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(56,189,248,.18);
}

/* ─── Tarification ────────────────────────────────────────────────────────── */
.tarif-card {
  background: linear-gradient(135deg, rgba(52,211,153,.03), rgba(56,189,248,.02));
  border-color: rgba(52,211,153,.15);
}

.tarif-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.tarif-item {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  padding: 13px 15px;
}
.tarif-item.tarif-green  { border-color: rgba(52,211,153,.18);  background: rgba(52,211,153,.05); }
.tarif-item.tarif-cyan   { border-color: rgba(56,189,248,.18);  background: rgba(56,189,248,.04); }
.tarif-item.tarif-orange { border-color: rgba(251,146,60,.18);  background: rgba(251,146,60,.04); }

.tarif-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: 7px;
}
.tarif-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.tarif-item.tarif-green  .tarif-value { color: var(--green); }
.tarif-item.tarif-cyan   .tarif-value { color: var(--cyan); }
.tarif-item.tarif-orange .tarif-value { color: var(--orange); }

.tarif-sub {
  font-size: .72rem;
  color: var(--muted);
  margin-top: 3px;
}

/* ─── Messages admin → client ─────────────────────────────────────────────── */
.messages-list { display: flex; flex-direction: column; gap: 8px; }

.message-card {
  background: rgba(129,140,248,.05);
  border: 1px solid rgba(129,140,248,.16);
  border-radius: 11px;
  overflow: hidden;
  transition: border-color .2s;
}
.message-card.unread {
  border-color: rgba(129,140,248,.35);
  background: rgba(129,140,248,.08);
}
.message-card:hover { border-color: rgba(129,140,248,.35); }

.message-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  cursor: pointer;
  user-select: none;
}
.message-sujet {
  font-weight: 600;
  font-size: .9rem;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}
.message-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--indigo);
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(129,140,248,.6);
}
.message-date {
  font-size: .74rem;
  color: var(--muted);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.message-chevron svg { transition: transform .25s ease; color: var(--muted); }

.message-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s ease;
  border-top: 0 solid rgba(129,140,248,.15);
}
.message-card.open .message-body {
  max-height: 800px;
  border-top-width: 1px;
}
.message-contenu {
  padding: 14px 16px;
  font-size: .88rem;
  color: var(--text);
  line-height: 1.7;
}

@keyframes badgePulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.08); }
}

/* ─── Conversations client (thread UI) ───────────────────────────────────── */
.client-conv {
  padding: 0;
  transition: background .18s;
}
.client-conv:hover { background: rgba(255,255,255,.012); }
.client-conv.archived { opacity: .82; }

.client-conv-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  cursor: pointer;
  user-select: none;
  transition: background .18s;
}
.client-conv-header:hover { background: rgba(255,255,255,.03); }

.client-conv-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .38s ease;
  border-top: 0 solid rgba(129,140,248,.13);
}
.client-conv-body.open {
  max-height: 900px;
  border-top-width: 1px;
}

/* ─── Thread bubbles (partagé admin+client views) ─────────────────────────── */
.conv-thread {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 0 12px;
}

.thread-bubble {
  max-width: 80%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.thread-bubble.admin  { align-self: flex-start; }
.thread-bubble.client { align-self: flex-end; }

.bubble-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}
.thread-bubble.client .bubble-meta { flex-direction: row-reverse; }

.bubble-who {
  font-size: .72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.bubble-time {
  font-size: .7rem;
  color: rgba(148,163,184,.5);
}

.bubble-content {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: .875rem;
  line-height: 1.65;
  word-break: break-word;
}
.thread-bubble.admin .bubble-content {
  background: rgba(56,189,248,.08);
  border: 1px solid rgba(56,189,248,.15);
  border-radius: 4px 12px 12px 12px;
  color: var(--text);
}
.thread-bubble.client .bubble-content {
  background: rgba(129,140,248,.12);
  border: 1px solid rgba(129,140,248,.20);
  border-radius: 12px 4px 12px 12px;
  color: var(--text);
}

.thread-closed {
  align-self: center;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .73rem;
  color: rgba(148,163,184,.5);
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.07);
  padding: 5px 14px;
  border-radius: 20px;
  margin: 4px auto;
}

/* ─── Reply textarea ──────────────────────────────────────────────────────── */
.reply-textarea {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--glass-bd);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--text);
  transition: border-color .2s;
}
.reply-textarea:focus {
  outline: none;
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(129,140,248,.1);
}

/* ─── Sections archivées ──────────────────────────────────────────────────── */
.archive-section {
  background: rgba(255,255,255,.025);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}

.archive-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: color .2s, background .2s;
  font-family: inherit;
}
.archive-toggle:hover { color: var(--text); background: rgba(255,255,255,.03); }

.archive-count {
  background: rgba(148,163,184,.14);
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}

.archive-chev {
  transition: transform .25s ease;
}
.archive-section.open .archive-chev { transform: rotate(180deg); }

.archive-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s ease;
  border-top: 0 solid rgba(255,255,255,.07);
}
.archive-section.open .archive-body {
  max-height: 2000px;
  border-top-width: 1px;
}

/* ─── Animations ──────────────────────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Responsive ──────────────────────────────────────────────────────────── */

/* Tablette — 768px */
@media (max-width: 768px) {
  .client-nav { padding: 0 20px; }
  .nav-welcome { font-size: .82rem; }
  .client-main { padding: 24px 20px; }

  /* Cards */
  .glass-card { padding: 20px 18px; }

  /* Projet */
  .project-header { gap: 10px; }

  /* Messages */
  .client-conv-header { padding: 13px 18px; }
  .thread-bubble { max-width: 88%; }
  .bubble-content { padding: 9px 12px; }
}

/* Mobile — 640px */
@media (max-width: 640px) {
  /* Nav mobile : logo + déconnexion, texte accueil raccourci */
  .client-nav { padding: 0 16px; height: 54px; gap: 10px; }
  .nav-welcome { font-size: .78rem; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

  /* Main */
  .client-main { padding: 16px 14px; }

  /* Cards */
  .glass-card { padding: 16px 14px; border-radius: 11px; }

  /* Projet */
  .project-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .project-statut { align-self: flex-start; }

  /* Progress steps */
  .step-label { font-size: .62rem; }
  .step-dot { width: 26px; height: 26px; font-size: .7rem; }
  .step-track { top: 17px; } /* recalculé : 26/2 + 4px padding */

  /* Grilles */
  .stats-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .stat-card { padding: 14px 12px; }
  .stat-value { font-size: 1.4rem; }
  .stat-label { font-size: .68rem; }
  .stat-icon { width: 28px; height: 28px; }
  .stat-icon svg { width: 14px; height: 14px; }

  /* Page header */
  .page-header { flex-direction: column; align-items: flex-start; gap: 10px; margin-bottom: 16px; }
  .page-header h1 { font-size: 1.25rem; }

  /* card-header */
  .card-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .card-header .btn-primary { align-self: flex-start; }

  /* Forms */
  .field-row { grid-template-columns: 1fr; }
  .field { margin-bottom: 14px; }

  /* Type selector (nouvelle demande) */
  .type-selector { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .type-option { padding: 12px 8px; }
  .type-option .type-icon { font-size: 1.3rem; }
  .type-option .type-label { font-size: .7rem; }

  /* Priority selector */
  .priority-selector { grid-template-columns: 1fr; gap: 6px; }

  /* Demandes */
  .demande-summary { padding: 13px 14px; }
  .demande-top { flex-wrap: wrap; gap: 6px; }
  .demande-body-inner { padding: 14px 14px 16px; }

  /* Messages / conversations */
  .client-conv-header { padding: 13px 14px; gap: 8px; }
  .client-conv-body .conv-thread { padding: 0 14px; }
  .thread-bubble { max-width: 92%; }
  .bubble-content { padding: 8px 11px; font-size: .84rem; }

  /* Reply form */
  .client-conv-body > div { padding: 10px 14px 16px; }

  /* Archive sections */
  .archive-toggle { padding: 12px 14px; font-size: .84rem; }
  .archive-section { border-radius: 11px; }

  /* CTA bottom card */
  .glass-card .btn-primary { align-self: flex-start; }
}

/* Mobile petit — 480px */
@media (max-width: 480px) {
  /* Nav : cache le texte de bienvenue sur très petits écrans */
  .nav-welcome { display: none; }
  .client-nav { justify-content: space-between; }

  /* Main */
  .client-main { padding: 12px 12px; }

  /* Cards */
  .glass-card { padding: 14px 12px; }

  /* Stats */
  .stats-grid { gap: 8px; }
  .stat-card { padding: 12px 10px; }
  .stat-value { font-size: 1.25rem; }
  .stat-label { font-size: .64rem; letter-spacing: 0; }

  /* Type selector */
  .type-selector { grid-template-columns: repeat(2, 1fr); }

  /* Conversations */
  .thread-bubble { max-width: 96%; }
  .bubble-content { font-size: .82rem; }

  /* Progress labels masqués sur très petits écrans */
  .step-label { display: none; }
  .project-progress { margin-top: 14px; }
}

/* Très petit — 360px */
@media (max-width: 360px) {
  .client-main { padding: 10px 10px; }
  .glass-card { padding: 12px 10px; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .stat-card { padding: 10px 8px; }
  .stat-value { font-size: 1.1rem; }
  .type-selector { grid-template-columns: repeat(2, 1fr); gap: 5px; }
}
