/* ═══════════════════════════════════════════════════
   STEP BY STEP — CLIENT VIEW
   Dark, modern, responsive
═══════════════════════════════════════════════════ */

:root {
  --primary: #4f46e5;
  --primary-light: #6366f1;
  --accent: #a78bfa;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg: #0a0a12;
  --surface: #111120;
  --card: #16162a;
  --card-hover: #1c1c35;
  --border: #1e1e35;
  --border-light: #2a2a45;
  --text: #f1f5f9;
  --muted: #64748b;
  --muted-light: #94a3b8;
  --radius: 14px;
  --radius-sm: 8px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ─── SPLASH / LOADING / ERROR ──────────────────── */
.splash {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  background-image: radial-gradient(ellipse 60% 40% at 50% 0%, rgba(79,70,229,0.12) 0%, transparent 70%);
  z-index: 9999;
}
.splash-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  text-align: center;
  padding: 2rem;
}
.splash-logo { font-size: 3.5rem; line-height: 1; }
.splash-spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.splash p { color: var(--muted-light); font-size: 0.9rem; }
.splash h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.25rem; }

/* ─── TOPBAR ─────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  background: rgba(10,10,18,0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.topbar-logo {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.topbar-logo span { color: var(--accent); }
.provider-badge {
  font-size: 0.78rem;
  color: var(--muted-light);
  background: var(--card);
  border: 1px solid var(--border-light);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
}

/* ─── PROJECT HERO ───────────────────────────────── */
.project-hero {
  background: linear-gradient(180deg, rgba(79,70,229,0.1) 0%, transparent 100%);
  border-bottom: 1px solid var(--border);
  padding: 2.5rem 1.5rem 2rem;
}
.project-hero-inner {
  max-width: 800px;
  margin: 0 auto;
}
.project-hero-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.type-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: rgba(167,139,250,0.12);
  border: 1px solid rgba(167,139,250,0.25);
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
}
.status-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
}
.status-badge.active { background: rgba(16,185,129,0.12); border: 1px solid rgba(16,185,129,0.3); color: #6ee7b7; }
.status-badge.archived { background: rgba(100,116,139,0.15); border: 1px solid rgba(100,116,139,0.3); color: var(--muted-light); }

.project-title {
  font-size: clamp(1.6rem, 5vw, 2.5rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 0.35rem;
  background: linear-gradient(135deg, #fff 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.project-client {
  color: var(--muted-light);
  font-size: 0.95rem;
  margin-bottom: 1.75rem;
}

/* Progress */
.progress-wrap { margin-top: 0.5rem; }
.progress-track {
  width: 100%;
  height: 10px;
  background: var(--border-light);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.6rem;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: 999px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
  position: relative;
}
.progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.15) 50%, transparent 100%);
  animation: shimmer 2s infinite;
}
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.progress-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.progress-label { font-size: 0.8rem; color: var(--muted-light); }
.progress-pct { font-size: 1.1rem; font-weight: 800; color: var(--accent); }

/* ─── CONTENT WRAP ───────────────────────────────── */
.content-wrap {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

/* ─── SECTIONS ───────────────────────────────────── */
.section {}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.section-title {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
}
.section-title svg { color: var(--accent); flex-shrink: 0; }
.steps-summary {
  font-size: 0.8rem;
  color: var(--muted-light);
  background: var(--card);
  border: 1px solid var(--border);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
}

/* ─── STEPS GRID ─────────────────────────────────── */
.steps-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
}

/* Timeline line */
.steps-grid::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 24px;
  bottom: 24px;
  width: 2px;
  background: linear-gradient(180deg, var(--primary) 0%, var(--border) 100%);
  border-radius: 999px;
  z-index: 0;
}

.step-card {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 1rem;
  align-items: start;
  position: relative;
  z-index: 1;
  animation: fadeSlideIn 0.4s ease-out both;
}
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.step-icon-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 0.85rem;
}
.step-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border-light);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s ease;
  font-size: 10px;
}
.step-card.completed .step-dot {
  background: var(--success);
  border-color: var(--success);
  box-shadow: 0 0 0 4px rgba(16,185,129,0.15);
}
.step-card.in_progress .step-dot {
  background: var(--warning);
  border-color: var(--warning);
  box-shadow: 0 0 0 4px rgba(245,158,11,0.15);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 4px rgba(245,158,11,0.15); }
  50% { box-shadow: 0 0 0 8px rgba(245,158,11,0.08); }
}

.step-body {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.step-card.completed .step-body {
  border-color: rgba(16,185,129,0.25);
  background: rgba(16,185,129,0.04);
}
.step-card.in_progress .step-body {
  border-color: rgba(245,158,11,0.35);
  background: rgba(245,158,11,0.04);
  box-shadow: 0 4px 20px rgba(245,158,11,0.08);
}
.step-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.35rem;
}
.step-card.completed .step-name { color: var(--muted-light); }
.step-status-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.step-status-label.pending { color: var(--muted); }
.step-status-label.in_progress { color: var(--warning); }
.step-status-label.completed { color: var(--success); }
.step-num {
  font-size: 0.7rem;
  color: var(--muted);
  margin-left: auto;
  float: right;
  line-height: 1.6rem;
}

/* ─── MESSAGES ───────────────────────────────────── */
.messages-list { display: flex; flex-direction: column; gap: 0.75rem; }
.message-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: border-color 0.2s;
}
.message-card:hover { border-color: var(--border-light); }
.message-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.message-author {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.message-author::before { content: '👤'; font-size: 0.9rem; }
.message-date { font-size: 0.75rem; color: var(--muted); }
.message-text { font-size: 0.9rem; color: var(--muted-light); line-height: 1.7; }

/* ─── FILES ──────────────────────────────────────── */
.files-grid { display: flex; flex-direction: column; gap: 0.75rem; }
.file-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  transition: border-color 0.2s, transform 0.15s;
  text-decoration: none;
}
.file-card:hover { border-color: var(--primary); transform: translateX(4px); }
.file-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: rgba(79,70,229,0.15);
  border: 1px solid rgba(79,70,229,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.file-info { flex: 1; min-width: 0; }
.file-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.15rem;
}
.file-meta { font-size: 0.78rem; color: var(--muted); }
.file-download-icon {
  color: var(--muted);
  transition: color 0.2s;
}
.file-card:hover .file-download-icon { color: var(--accent); }

/* ─── GALLERY / IMAGE FILES ──────────────────────── */
.files-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
}
.gallery-item {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 4/3;
  background: var(--card);
  position: relative;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.gallery-item:hover img { transform: scale(1.05); }
.gallery-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  color: white;
  font-size: 1.5rem;
}
.gallery-item:hover .gallery-overlay { opacity: 1; }

/* ─── FOOTER ─────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.78rem;
}
.site-footer strong { color: var(--muted-light); }

/* ─── EMPTY STATES ───────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--muted);
  font-size: 0.875rem;
  background: var(--card);
  border: 1px dashed var(--border-light);
  border-radius: var(--radius);
}

/* ─── RESPONSIVE ─────────────────────────────────── */
@media (max-width: 600px) {
  .project-hero { padding: 1.75rem 1rem 1.5rem; }
  .content-wrap { padding: 1.5rem 1rem 3rem; }
  .topbar { padding: 0 1rem; }
  .project-title { font-size: 1.5rem; }
  .steps-grid::before { left: 13px; }
  .step-card { grid-template-columns: 30px 1fr; gap: 0.75rem; }
  .step-dot { width: 16px; height: 16px; }
  .files-gallery { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}
