/* =============================================================================
   VidPipe Studio — Team Interface
   Uses unified tokens from tokens.css. Inter font (matches Admin).
   All .t-* classes preserved (JSX dependency).
   ============================================================================= */

.team-app {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
}

/* === Header === */
.t-header {
  padding: var(--space-4) var(--space-10);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}
.t-brand { display: flex; align-items: center; gap: var(--space-3); }
.t-brand-dot {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--color-brand), var(--color-brand-hover));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: var(--weight-extrabold);
  color: #fff;
  box-shadow: 0 4px 12px rgba(91, 94, 244, 0.30);
}
.t-brand-name {
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
}
.t-header-right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.t-back {
  font-size: var(--text-sm);
  color: var(--color-text-3);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-1);
  background: none;
  border: none;
  font-family: inherit;
  font-weight: var(--weight-medium);
  transition: color var(--duration-fast) var(--ease);
}
.t-back:hover { color: var(--color-text); }
.t-user {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3) var(--space-1) var(--space-1);
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border-strong);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-2);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease);
}
.t-user:hover {
  border-color: var(--color-border-stronger);
  background: var(--color-surface-2);
}
.t-user-dot {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-pill);
  background: var(--color-brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
}
.t-chrono {
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--color-warn-soft);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-warn);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}
.t-theme-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-3);
  font-size: var(--text-base);
  transition: all var(--duration-fast) var(--ease);
}
.t-theme-btn:hover {
  border-color: var(--color-border-strong);
  color: var(--color-text);
}

/* === Progress === */
.t-progress { padding: 0 var(--space-10); margin-top: var(--space-5); }
.t-progress-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.t-progress-bar {
  flex: 1;
  height: 4px;
  background: var(--color-surface-2);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.t-progress-fill {
  height: 100%;
  background: var(--color-brand);
  border-radius: var(--radius-pill);
  transition: width 0.5s var(--ease);
}
.t-progress-label {
  font-size: var(--text-xs);
  color: var(--color-text-3);
  white-space: nowrap;
  font-weight: var(--weight-semibold);
  min-width: 60px;
  text-align: right;
}

/* === Main === */
.t-main {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--space-8) var(--space-10) var(--space-16);
}
.t-page-top {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
}
.t-page-title {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tighter);
}
.t-page-id {
  font-size: var(--text-xs);
  color: var(--color-text-3);
  font-family: var(--font-mono);
}

/* === Layout === */
.t-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: var(--space-6);
  align-items: start;
}

/* === Step indicator === */
.t-step { margin-bottom: var(--space-5); }
.t-step-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.t-sn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-pill);
  background: var(--color-surface-2);
  color: var(--color-text-3);
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1.5px solid var(--color-border);
  transition: all var(--duration-base) var(--ease);
}
.t-sn.done {
  background: var(--color-brand);
  border-color: var(--color-brand);
  color: #fff;
}
.t-st {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text);
}
.t-step-opt {
  font-size: var(--text-xs);
  color: var(--color-text-3);
  margin-left: auto;
  font-weight: var(--weight-medium);
}

.t-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  transition: border-color var(--duration-fast) var(--ease);
}
.t-card:hover { border-color: var(--color-border-strong); }

/* === Products === */
.t-prod-list {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.t-prod {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease);
  background: var(--color-surface);
  flex: 1;
  min-width: 200px;
}
.t-prod:hover {
  border-color: var(--color-border-strong);
  background: var(--color-surface-2);
}
.t-prod.sel {
  border-color: var(--color-brand);
  background: var(--color-brand-soft);
}
.t-prod-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--color-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.t-prod-icon img { width: 100%; height: 100%; object-fit: cover; }
.t-prod-info { flex: 1; min-width: 0; }
.t-prod-info .pn {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.t-prod-info .pm {
  font-size: var(--text-xs);
  color: var(--color-text-3);
  margin-top: 2px;
}
.t-prod .pc {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--color-border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-fast) var(--ease);
  flex-shrink: 0;
}
.t-prod .pc svg { width: 12px; height: 12px; color: #fff; opacity: 0; transition: opacity var(--duration-fast); }
.t-prod.sel .pc {
  background: var(--color-brand);
  border-color: var(--color-brand);
}
.t-prod.sel .pc svg { opacity: 1; }

/* === Script === */
.t-script {
  width: 100%;
  min-height: 180px;
  padding: var(--space-3) var(--space-4);
  border: 1.5px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--color-text);
  line-height: var(--leading-relaxed);
  resize: vertical;
  transition: border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease);
  background: var(--color-surface);
}
.t-script::placeholder { color: var(--color-text-3); }
.t-script:focus {
  outline: none;
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px var(--color-brand-soft);
}
.t-script-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-2);
}
.t-char-count {
  font-size: var(--text-xs);
  color: var(--color-text-3);
  font-family: var(--font-mono);
}

/* === Avatar drop === */
.t-av-drop {
  border: 1.5px dashed var(--color-border-strong);
  border-radius: var(--radius-md);
  padding: var(--space-8) var(--space-5);
  text-align: center;
  cursor: pointer;
  transition: all var(--duration-base) var(--ease);
}
.t-av-drop:hover {
  border-color: var(--color-brand);
  background: var(--color-brand-soft);
}
.t-av-drop-ic {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  background: var(--color-brand-soft);
  color: var(--color-brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-2);
  font-size: var(--text-lg);
}
.t-av-drop-t {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
}
.t-av-drop-s {
  font-size: var(--text-xs);
  color: var(--color-text-3);
  margin-top: var(--space-1);
}

/* === Avatar preview === */
.t-av-prev {
  display: flex;
  gap: var(--space-4);
  align-items: center;
}
.t-av-prev-img {
  width: 80px;
  height: 100px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 2px solid var(--color-success);
  flex-shrink: 0;
}
.t-av-prev-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--color-success);
  margin-bottom: var(--space-1);
}
.t-av-prev-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--color-success);
}
.t-av-prev-hint {
  font-size: var(--text-xs);
  color: var(--color-text-3);
  line-height: var(--leading-snug);
}
.t-av-prev-btn {
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-brand);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: var(--weight-semibold);
  padding: 0;
}
.t-av-prev-btn:hover { text-decoration: underline; }

/* === Library === */
.t-lib-label {
  font-size: var(--text-xs);
  color: var(--color-text-3);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  font-weight: var(--weight-bold);
  margin: var(--space-3) 0 var(--space-2);
}

/* === Summary === */
.t-summary {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}
.t-summary-ic {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
}
.t-summary-ic img { width: 100%; height: 100%; object-fit: cover; }
.t-summary-n {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
}
.t-summary-m {
  font-size: var(--text-xs);
  color: var(--color-text-3);
  margin-top: 2px;
}

/* === Generate button === */
.t-btn-go {
  width: 100%;
  padding: var(--space-4);
  background: var(--color-brand);
  border: none;
  border-radius: var(--radius-md);
  color: #fff;
  font-family: var(--font-sans);
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  letter-spacing: var(--tracking-tight);
}
.t-btn-go:hover {
  background: var(--color-brand-hover);
  box-shadow: var(--shadow-brand);
}
.t-btn-go:active { transform: scale(0.98); }
.t-btn-go:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}
.t-gen-sub {
  text-align: center;
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-3);
}

/* === Scene cards === */
.t-scene-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  transition: border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease);
}
.t-scene-card:hover {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-sm);
}
.t-scene-card.approved {
  border-color: var(--color-success);
  box-shadow: 0 0 0 1px var(--color-success-soft);
}
.t-scene-img {
  width: 100%;
  aspect-ratio: 9/16;
  object-fit: cover;
  display: block;
}
.t-scene-label {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: #fff;
  letter-spacing: var(--tracking-tight);
}
.t-scene-check {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  width: 24px;
  height: 24px;
  border-radius: var(--radius-pill);
  background: var(--color-success);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.40);
}
.t-scene-info { padding: var(--space-3); }
.t-scene-title {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
}
.t-scene-dur {
  font-size: var(--text-xs);
  color: var(--color-text-3);
  margin-top: 2px;
}

/* === Buttons === */
.t-btn {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease);
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  border: none;
}
.t-btn-approve {
  background: var(--color-success);
  color: #fff;
}
.t-btn-approve:hover { opacity: 0.9; }
.t-btn-regen {
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  color: var(--color-text-2);
}
.t-btn-regen:hover {
  border-color: var(--color-border-stronger);
  background: var(--color-surface-2);
}
.t-btn-ghost {
  background: none;
  border: none;
  color: var(--color-text-3);
  font-size: var(--text-xs);
}
.t-btn-ghost:hover { color: var(--color-brand); }
.t-btn-download {
  background: var(--color-brand);
  color: #fff;
  text-decoration: none;
}
.t-btn-download:hover { background: var(--color-brand-hover); }

/* === Center content === */
.t-center {
  text-align: center;
  max-width: 500px;
  margin: 0 auto;
}

/* === Spinner === */
.t-spin {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid var(--color-border-strong);
  border-top-color: var(--color-brand);
  border-radius: var(--radius-pill);
  animation: spin 0.7s linear infinite;
}
.t-spin-lg { width: 48px; height: 48px; border-width: 4px; }

/* === Feedback input === */
.t-input {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 1.5px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-text);
  background: var(--color-surface);
  transition: border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease);
}
.t-input:focus {
  outline: none;
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px var(--color-brand-soft);
}
.t-input::placeholder { color: var(--color-text-3); }

/* === Animation === */
@keyframes tUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.t-anim {
  animation: tUp 0.4s var(--ease) forwards;
  opacity: 0;
}
.t-d1 { animation-delay: 0.04s; }
.t-d2 { animation-delay: 0.08s; }
.t-d3 { animation-delay: 0.12s; }
.t-d4 { animation-delay: 0.16s; }

/* === Stars === */
.t-star {
  cursor: pointer;
  font-size: var(--text-lg);
  background: none;
  border: none;
  transition: color var(--duration-fast) var(--ease);
  padding: 0 2px;
}
.t-star.on { color: var(--color-warn); }
.t-star.off { color: var(--color-text-4); }

@media (max-width: 860px) {
  .t-layout { grid-template-columns: 1fr; }
  .t-main { padding: var(--space-6) var(--space-5); }
  .t-header { padding: var(--space-4) var(--space-5); }
  .t-progress { padding: 0 var(--space-5); }
}
