/* ── Reset & Base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --c-bg: #f8f9fb;
  --c-surface: #ffffff;
  --c-border: #e2e6ed;
  --c-border-light: #f0f2f5;
  --c-text: #1a1d26;
  --c-text-secondary: #5f6980;
  --c-text-muted: #8d95a7;
  --c-primary: #4f46e5;
  --c-primary-hover: #4338ca;
  --c-primary-light: #eef2ff;
  --c-primary-lighter: #f5f3ff;
  --c-success: #059669;
  --c-success-light: #ecfdf5;
  --c-warning: #d97706;
  --c-warning-light: #fffbeb;
  --c-danger: #dc2626;
  --c-danger-light: #fef2f2;
  --c-info: #0284c7;
  --c-info-light: #f0f9ff;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.07);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.08);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition: 150ms ease;
}

html { font-size: 15px; }
body {
  font-family: var(--font);
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--c-primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--c-primary-hover); }
img, video { max-width: 100%; display: block; }
h1, h2, h3, h4 { line-height: 1.3; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 1.85rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p { color: var(--c-text-secondary); }

/* ── Layout ──────────────────────────────────────────────────────── */
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 1.25rem; }
.wrap-narrow { max-width: 520px; margin: 0 auto; padding: 0 1.25rem; }
.wrap-mid { max-width: 780px; margin: 0 auto; padding: 0 1.25rem; }

/* ── Header ──────────────────────────────────────────────────────── */
.site-header {
  background: linear-gradient(135deg, #312e81 0%, #4f46e5 50%, #6366f1 100%);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(79,70,229,0.18);
}
.site-header .inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.site-header .logo {
  color: #fff;
  font-size: 1.15rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.site-header .logo span { opacity: 0.55; font-weight: 400; font-size: 0.8rem; }
.site-header nav { display: flex; align-items: center; gap: 0.25rem; }
.site-header nav a {
  color: rgba(255,255,255,0.78);
  font-size: 0.87rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.site-header nav a:hover { color: #fff; background: rgba(255,255,255,0.1); }
.site-header .user-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255,255,255,0.12);
  color: #fff;
  padding: 0.3rem 0.85rem 0.3rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 500;
}
.site-header .user-pill .avatar-circle {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 700;
}

.site-header .lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.85rem;
  margin-left: 0.5rem;
  padding: 0 0.5rem;
}
.site-header .lang-switcher a {
  color: rgba(255,255,255,0.78);
  padding: 0.2rem 0.35rem;
  border-radius: var(--radius-sm);
}
.site-header .lang-switcher a:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}
.site-header .lang-switcher a.active {
  color: #fff;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.site-header .lang-switcher .lang-sep {
  color: rgba(255,255,255,0.5);
  pointer-events: none;
}

/* ── Main ────────────────────────────────────────────────────────── */
main { padding: 2rem 0 4rem; min-height: calc(100vh - 56px); }

/* ── Cards ────────────────────────────────────────────────────────── */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); border-color: #d0d5e0; }
.card-flat { box-shadow: none; }
.card-flat:hover { box-shadow: none; }
.card + .card { margin-top: 0.75rem; }
.card-link { display: block; text-decoration: none; color: inherit; cursor: pointer; }
.card-link:hover { color: inherit; }

/* ── Stat Cards ──────────────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.75rem; margin-bottom: 2rem; }
.stat-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  text-align: center;
}
.stat-card .stat-value { font-size: 2rem; font-weight: 750; letter-spacing: -0.02em; color: var(--c-primary); }
.stat-card .stat-label { font-size: 0.8rem; color: var(--c-text-muted); font-weight: 500; margin-top: 0.15rem; text-transform: uppercase; letter-spacing: 0.04em; }

/* ── Grid ────────────────────────────────────────────────────────── */
.grid { display: grid; gap: 0.75rem; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

/* ── Badges ──────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15em 0.65em;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.badge-open { background: var(--c-success-light); color: var(--c-success); }
.badge-in_progress { background: var(--c-warning-light); color: var(--c-warning); }
.badge-review { background: var(--c-info-light); color: var(--c-info); }
.badge-completed { background: #f3f4f6; color: #6b7280; }
.badge-cancelled { background: var(--c-danger-light); color: var(--c-danger); }
.badge-pending { background: var(--c-warning-light); color: var(--c-warning); }
.badge-accepted { background: var(--c-success-light); color: var(--c-success); }
.badge-rejected { background: var(--c-danger-light); color: var(--c-danger); }
.badge-submitted { background: var(--c-info-light); color: var(--c-info); }
.badge-revision_requested { background: var(--c-warning-light); color: var(--c-warning); }
.badge-frozen { background: var(--c-info-light); color: var(--c-info); }
.badge-released { background: var(--c-success-light); color: var(--c-success); }
.badge-refunded { background: var(--c-danger-light); color: var(--c-danger); }
.badge-brand { background: var(--c-primary-light); color: var(--c-primary); }
.badge-creator { background: var(--c-success-light); color: var(--c-success); }

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-md);
  font-size: 0.87rem;
  font-weight: 600;
  font-family: inherit;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  line-height: 1.4;
  white-space: nowrap;
}
.btn:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; }
.btn-primary { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.btn-primary:hover { background: var(--c-primary-hover); border-color: var(--c-primary-hover); color: #fff; }
.btn-secondary { background: var(--c-surface); color: var(--c-text); border-color: var(--c-border); }
.btn-secondary:hover { background: var(--c-bg); border-color: #c8cdd7; color: var(--c-text); }
.btn-danger { background: var(--c-danger); color: #fff; border-color: var(--c-danger); }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.btn-ghost { background: transparent; color: var(--c-text-secondary); border-color: transparent; }
.btn-ghost:hover { background: var(--c-bg); color: var(--c-text); }
.btn-sm { padding: 0.35rem 0.8rem; font-size: 0.8rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 0.7rem 1.6rem; font-size: 0.95rem; border-radius: var(--radius-md); }
.btn-block { width: 100%; }

/* ── Forms ────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.15rem; }
.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: 0.35rem;
}
.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--c-text);
  background: var(--c-surface);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}
.form-input::placeholder, .form-textarea::placeholder {
  color: var(--c-text-muted);
}
.form-textarea { resize: vertical; min-height: 100px; line-height: 1.6; }
.form-hint { font-size: 0.78rem; color: var(--c-text-muted); margin-top: 0.3rem; }
.form-error { font-size: 0.82rem; color: var(--c-danger); margin-top: 0.75rem; display: none; padding: 0.6rem 0.85rem; background: var(--c-danger-light); border-radius: var(--radius-sm); }
.form-error.visible { display: block; }

.radio-group { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.radio-option {
  position: relative;
}
.radio-option input { position: absolute; opacity: 0; pointer-events: none; }
.radio-option .radio-label {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-md);
  font-size: 0.87rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--c-text-secondary);
}
.radio-option input:checked + .radio-label {
  border-color: var(--c-primary);
  background: var(--c-primary-light);
  color: var(--c-primary);
  font-weight: 600;
}
.radio-option .radio-label:hover {
  border-color: #c0bef0;
  background: var(--c-primary-lighter);
}

/* ── Hero ────────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 4rem 1rem 3rem;
}
.hero h1 {
  font-size: 2.65rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, #312e81, #4f46e5, #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p {
  font-size: 1.12rem;
  color: var(--c-text-secondary);
  max-width: 540px;
  margin: 0 auto 2rem;
  line-height: 1.65;
}
.hero-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }

/* ── Section Headers ─────────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.15rem;
  gap: 1rem;
}
.section-header h2 { margin: 0; }

/* ── Order Card ──────────────────────────────────────────────────── */
.order-card .order-title {
  font-size: 1rem;
  font-weight: 650;
  color: var(--c-text);
  margin-bottom: 0.4rem;
}
.order-card .order-title a { color: inherit; }
.order-card .order-title a:hover { color: var(--c-primary); }
.order-card .order-desc {
  font-size: 0.84rem;
  color: var(--c-text-secondary);
  line-height: 1.55;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.order-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.8rem;
  color: var(--c-text-muted);
}
.order-meta strong { color: var(--c-text); font-weight: 600; }

/* ── Chat ────────────────────────────────────────────────────────── */
.chat-container {
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  background: var(--c-surface);
  overflow: hidden;
}
.chat-messages {
  max-height: 480px;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.chat-bubble {
  max-width: 75%;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-lg);
  font-size: 0.9rem;
  line-height: 1.5;
  position: relative;
}
.chat-bubble-mine {
  align-self: flex-end;
  background: var(--c-primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-bubble-other {
  align-self: flex-start;
  background: #f1f3f7;
  color: var(--c-text);
  border-bottom-left-radius: 4px;
}
.chat-sender { font-size: 0.72rem; font-weight: 600; margin-bottom: 0.15rem; color: var(--c-text-muted); }
.chat-bubble-mine .chat-sender { color: rgba(255,255,255,0.7); }
.chat-time { font-size: 0.68rem; color: var(--c-text-muted); margin-top: 0.2rem; }
.chat-bubble-mine .chat-time { color: rgba(255,255,255,0.6); }
.chat-input {
  display: flex;
  gap: 0.5rem;
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--c-border);
  background: var(--c-bg);
}
.chat-input input { flex: 1; }

/* ── Stars ────────────────────────────────────────────────────────── */
.stars { color: var(--c-warning); letter-spacing: 1px; }
.stars-empty { color: #ddd; }

/* ── Conversation List ───────────────────────────────────────────── */
.conv-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--c-border-light);
  transition: background var(--transition);
  text-decoration: none;
  color: inherit;
}
.conv-item:last-child { border-bottom: none; }
.conv-item:hover { background: var(--c-bg); color: inherit; }
.conv-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--c-primary-light);
  color: var(--c-primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem;
  flex-shrink: 0;
}
.conv-info { flex: 1; min-width: 0; }
.conv-name { font-weight: 600; font-size: 0.9rem; }
.conv-preview { font-size: 0.8rem; color: var(--c-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-meta { font-size: 0.72rem; color: var(--c-text-muted); flex-shrink: 0; }

/* ── Auth Pages ──────────────────────────────────────────────────── */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 56px);
  padding: 2rem 1rem;
}
.auth-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
}
.auth-card h1 {
  text-align: center;
  margin-bottom: 0.35rem;
  font-size: 1.5rem;
}
.auth-card .auth-subtitle {
  text-align: center;
  color: var(--c-text-muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}
.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: var(--c-text-muted);
}

/* ── Profile Header ──────────────────────────────────────────────── */
.profile-header {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}
.profile-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-primary-light), #ddd6fe);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; font-weight: 700; color: var(--c-primary);
  flex-shrink: 0;
}
.profile-info { flex: 1; }
.profile-info h1 { margin-bottom: 0.3rem; }
.profile-meta { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; font-size: 0.85rem; }

/* ── Empty ────────────────────────────────────────────────────────── */
.empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--c-text-muted);
}
.empty-icon { font-size: 2.5rem; margin-bottom: 0.75rem; opacity: 0.4; }
.empty p { margin-top: 0.5rem; }

/* ── Divider ─────────────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--c-border-light); margin: 1.25rem 0; }

/* ── Utilities ───────────────────────────────────────────────────── */
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-xs { gap: 0.35rem; }
.gap-sm { gap: 0.5rem; }
.gap-md { gap: 1rem; }
.gap-lg { gap: 1.5rem; }
.mt-xs { margin-top: 0.35rem; }
.mt-sm { margin-top: 0.5rem; }
.mt-md { margin-top: 1rem; }
.mt-lg { margin-top: 1.5rem; }
.mt-xl { margin-top: 2rem; }
.mb-sm { margin-bottom: 0.5rem; }
.mb-md { margin-bottom: 1rem; }
.mb-lg { margin-bottom: 1.5rem; }
.text-muted { color: var(--c-text-muted); }
.text-secondary { color: var(--c-text-secondary); }
.text-sm { font-size: 0.82rem; }
.text-xs { font-size: 0.75rem; }
.text-center { text-align: center; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* ── Upload Progress ─────────────────────────────────────────────── */
.upload-progress {
  display: none;
  margin-top: 0.85rem;
}
.upload-progress.active { display: block; }
.upload-progress-track {
  width: 100%;
  height: 8px;
  background: var(--c-border-light);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.upload-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--c-primary), #7c3aed);
  border-radius: var(--radius-full);
  width: 0%;
  transition: width 200ms ease;
}
.upload-progress-text {
  font-size: 0.78rem;
  color: var(--c-text-muted);
  margin-top: 0.35rem;
  text-align: center;
}

/* ── Video Embed ─────────────────────────────────────────────────── */
.video-embed {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  margin-bottom: 0.75rem;
}
.video-embed iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}
.references-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

/* ── Brief Detail ────────────────────────────────────────────────── */
.brief-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem 1.5rem;
  margin-top: 0.75rem;
}
.brief-grid .brief-item { }
.brief-grid .brief-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.brief-grid .brief-value {
  font-size: 0.88rem;
  color: var(--c-text);
  margin-top: 0.15rem;
}
.brief-grid .brief-full { grid-column: 1 / -1; }

/* ── Portfolio Gate ──────────────────────────────────────────────── */
.portfolio-gate {
  text-align: center;
  padding: 1.5rem;
  background: var(--c-warning-light);
  border: 1.5px solid #fcd34d;
  border-radius: var(--radius-lg);
}
.portfolio-gate .gate-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.portfolio-gate h3 { margin-bottom: 0.35rem; }
.portfolio-gate p { margin-bottom: 1rem; }
.portfolio-progress-bar {
  width: 100%;
  max-width: 280px;
  height: 8px;
  background: rgba(0,0,0,0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin: 0.75rem auto;
}
.portfolio-progress-fill {
  height: 100%;
  background: var(--c-warning);
  border-radius: var(--radius-full);
  transition: width 300ms ease;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .hero h1 { font-size: 1.85rem; }
  .hero { padding: 2.5rem 0.5rem 2rem; }
  .grid-2 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .auth-card { padding: 1.75rem; }
  .profile-header { flex-direction: column; align-items: center; text-align: center; }
  .section-header { flex-direction: column; align-items: flex-start; }
}
