/* ══════════════════════════════════════════════════════════
   Clips Immobiliers — Premium Dark Gold Design System
   ══════════════════════════════════════════════════════════ */

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

:root {
  /* Colors — Obsidian & Gold */
  --bg-primary: #07070d;
  --bg-secondary: #0e0e18;
  --bg-card: rgba(16, 16, 30, 0.75);
  --bg-card-hover: rgba(22, 22, 44, 0.9);
  --bg-glass: rgba(255, 255, 255, 0.035);
  --bg-glass-hover: rgba(255, 255, 255, 0.065);
  --bg-input: rgba(255, 255, 255, 0.05);
  --bg-input-focus: rgba(255, 255, 255, 0.08);
  --bg-elevated: rgba(20, 20, 36, 0.85);

  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-medium: rgba(255, 255, 255, 0.1);
  --border-accent: rgba(212, 168, 83, 0.35);

  --text-primary: #f0f0f5;
  --text-secondary: #8b8ba0;
  --text-muted: #55556a;
  --text-accent: #d4a853;

  --gold: #d4a853;
  --gold-light: #f0d89a;
  --gold-dark: #a07c33;
  --gold-dim: rgba(212, 168, 83, 0.12);
  --gold-glow: rgba(212, 168, 83, 0.25);

  --accent-blue: #4a9eff;
  --accent-green: #34d399;
  --accent-red: #f87171;
  --accent-purple: #a78bfa;

  --gradient-gold: linear-gradient(135deg, #d4a853 0%, #f0d89a 50%, #d4a853 100%);
  --gradient-gold-subtle: linear-gradient(135deg, rgba(212,168,83,0.15) 0%, rgba(240,216,154,0.08) 100%);
  --gradient-card: linear-gradient(145deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.01) 100%);

  /* Typography */
  --font-display: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
  --shadow-gold: 0 0 24px rgba(212, 168, 83, 0.2);
  --shadow-gold-lg: 0 4px 30px rgba(212, 168, 83, 0.25);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --transition-fast: 150ms var(--ease-out);
  --transition-base: 300ms var(--ease-out);
  --transition-slow: 500ms var(--ease-out);
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ── Ambient Background ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 600px 600px at 15% 40%, rgba(212, 168, 83, 0.04) 0%, transparent 70%),
    radial-gradient(ellipse 500px 500px at 85% 15%, rgba(74, 158, 255, 0.025) 0%, transparent 70%),
    radial-gradient(ellipse 400px 400px at 50% 90%, rgba(167, 139, 250, 0.02) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ══════════════════════════════════════════════
   Header
   ══════════════════════════════════════════════ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-2xl);
  background: rgba(7, 7, 13, 0.8);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.brand-icon {
  font-size: 1.6rem;
  display: flex;
  align-items: center;
}

.app-header h1 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ══════════════════════════════════════════════
   Buttons — Premium Gold System
   ══════════════════════════════════════════════ */
.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  line-height: 1;
  white-space: nowrap;
  border: none;
  outline: none;
}

.btn-primary {
  padding: 14px 28px;
  background: var(--gradient-gold);
  color: #0a0a0f;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: var(--shadow-gold);
  letter-spacing: 0.01em;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold-lg);
  filter: brightness(1.1);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-gold);
}

.btn-primary:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  filter: none;
}

.btn-secondary {
  padding: 12px 22px;
  background: var(--bg-glass);
  border: 1px solid var(--border-medium) !important;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.85rem;
  backdrop-filter: blur(8px);
}

.btn-secondary:hover {
  background: var(--bg-glass-hover);
  border-color: var(--gold) !important;
  color: var(--gold);
  transform: translateY(-1px);
  box-shadow: 0 0 16px rgba(212, 168, 83, 0.1);
}

.btn-danger {
  padding: 10px 18px;
  background: rgba(248, 113, 113, 0.08);
  color: var(--accent-red);
  border: 1px solid rgba(248, 113, 113, 0.15);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-danger:hover {
  background: rgba(248, 113, 113, 0.18);
  border-color: var(--accent-red);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 8px 16px !important;
  font-size: 0.8rem !important;
}

/* ══════════════════════════════════════════════
   Wizard Navigation
   ══════════════════════════════════════════════ */
.wizard-nav {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl) var(--space-xl) var(--space-lg);
  max-width: 600px;
  margin: 0 auto;
}

.wizard-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all var(--transition-base);
  opacity: 0.35;
}

.wizard-step.active { opacity: 1; }
.wizard-step.completed { opacity: 0.65; }

.step-number {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-glass);
  border: 2px solid var(--border-subtle);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  transition: all var(--transition-base);
}

.wizard-step.active .step-number {
  background: var(--gold-dim);
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: var(--shadow-gold);
}

.wizard-step.completed .step-number {
  background: rgba(52, 211, 153, 0.12);
  border-color: var(--accent-green);
  color: var(--accent-green);
}

.step-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  transition: all var(--transition-base);
}

.wizard-step.active .step-label {
  color: var(--gold);
}

.wizard-connector {
  flex: 1;
  height: 2px;
  background: var(--border-subtle);
  margin: 0 var(--space-md);
  margin-bottom: 22px;
  min-width: 40px;
  border-radius: 1px;
}

/* ══════════════════════════════════════════════
   Main Content & Panels
   ══════════════════════════════════════════════ */
.page-section {
  position: relative;
  z-index: 10;
  max-width: 900px;
  margin: 0 auto;
  padding: var(--space-lg) var(--space-2xl) var(--space-3xl);
}

.app-main {
  position: relative;
  z-index: 10;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 var(--space-2xl) var(--space-3xl);
  transition: margin-left 0.3s var(--ease-out);
}

/* Shift content when sidebar is visible */
body.sidebar-active .app-main,
body.sidebar-active .wizard-nav {
  margin-left: 240px;
}

.wizard-panel {
  display: none;
}

.wizard-panel.active {
  display: block;
  animation: panelIn 0.5s var(--ease-out) both;
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel-header {
  margin-bottom: var(--space-xl);
}

.panel-header h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}

.panel-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-top: var(--space-2xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

/* ══════════════════════════════════════════════
   Form Elements — Glassy Inputs
   ══════════════════════════════════════════════ */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

.input-field {
  padding: 14px 18px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.92rem;
  transition: all var(--transition-base);
  outline: none;
}

.input-field:focus {
  background: var(--bg-input-focus);
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-dim), var(--shadow-gold);
}

.input-field::placeholder {
  color: var(--text-muted);
}

select.input-field {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%238b8ba0' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

select.input-field option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* ── Broker selector ── */
.broker-selector {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.new-broker-fields {
  padding: var(--space-md);
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-top: var(--space-xs);
  animation: panelIn 0.3s var(--ease-out) both;
}

/* ══════════════════════════════════════════════
   Upload Zone — Breathing Border
   ══════════════════════════════════════════════ */
.upload-zone {
  position: relative;
  border: 2px dashed var(--border-medium);
  border-radius: var(--radius-xl);
  padding: var(--space-3xl) var(--space-xl);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-base);
  background: var(--gradient-gold-subtle);
  animation: breathe 3s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { border-color: rgba(212, 168, 83, 0.2); }
  50% { border-color: rgba(212, 168, 83, 0.45); }
}

.upload-zone:hover {
  border-color: var(--gold);
  background: rgba(212, 168, 83, 0.08);
  transform: scale(1.005);
  box-shadow: inset 0 0 40px rgba(212, 168, 83, 0.06);
  animation: none;
}

.upload-zone.drag-over {
  border-color: var(--gold);
  background: rgba(212, 168, 83, 0.12);
  box-shadow: inset 0 0 60px rgba(212, 168, 83, 0.1), var(--shadow-gold);
  animation: none;
  transform: scale(1.01);
}

.upload-icon {
  font-size: 2.8rem;
  margin-bottom: var(--space-md);
  filter: drop-shadow(0 0 8px rgba(212, 168, 83, 0.3));
}

.upload-zone p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.upload-link {
  color: var(--gold);
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: all var(--transition-fast);
}

.upload-link:hover {
  color: var(--gold-light);
  text-shadow: 0 0 8px rgba(212, 168, 83, 0.4);
}

.upload-hint {
  font-size: 0.8rem !important;
  color: var(--text-muted) !important;
}

/* ══════════════════════════════════════════════
   Photos Grid
   ══════════════════════════════════════════════ */
.photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--space-md);
  margin: var(--space-xl) 0;
}

.photo-card {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  aspect-ratio: 16/10;
  transition: all var(--transition-base);
}

.photo-card:hover {
  border-color: var(--gold);
  box-shadow: var(--shadow-gold);
  transform: translateY(-3px);
}

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  background: rgba(0,0,0,0.75);
  color: var(--accent-red);
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all var(--transition-fast);
}

.photo-card:hover .photo-remove { opacity: 1; }

.photo-remove:hover {
  background: var(--accent-red);
  color: #fff;
  border-color: var(--accent-red);
}

.photo-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 6px 10px;
  background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
  font-size: 0.65rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ══════════════════════════════════════════════
   Queue Section
   ══════════════════════════════════════════════ */
.queue-section {
  margin-top: var(--space-xl);
  padding: var(--space-xl);
  padding-bottom: var(--space-2xl);
  margin-bottom: var(--space-xl);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(10px);
}

.queue-section h3 {
  margin-bottom: var(--space-lg);
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
}

.queue-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.queue-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-glass);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
}

.queue-item:hover {
  background: var(--bg-glass-hover);
}

.queue-item-thumb {
  width: 56px;
  height: 38px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--border-subtle);
}

.queue-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.queue-item-info {
  flex: 1;
  min-width: 0;
}

.queue-item-name {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-item-status {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.queue-item-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.badge-pending { background: rgba(139, 139, 160, 0.12); color: var(--text-secondary); }
.badge-running { background: rgba(74, 158, 255, 0.12); color: var(--accent-blue); }
.badge-success, .badge-succeeded { background: rgba(52, 211, 153, 0.12); color: var(--accent-green); }
.badge-error, .badge-failed { background: rgba(248, 113, 113, 0.12); color: var(--accent-red); }

.progress-bar {
  height: 3px;
  width: 100%;
  background: var(--bg-glass);
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
  border-radius: 2px;
  transition: width 0.5s var(--ease-out);
}

/* Spinner */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--border-subtle);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

.gallery-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.gallery-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  padding: var(--space-lg);
  transition: all var(--transition-base);
  backdrop-filter: blur(10px);
}

.gallery-card:hover {
  border-color: rgba(212, 168, 83, 0.2);
  box-shadow: 0 4px 30px rgba(0,0,0,0.3);
}

.gallery-card-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.gallery-row {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
}

.gallery-video-cell {
  position: relative;
  flex-shrink: 0;
}

.gallery-video.landscape {
  width: 420px;
  max-width: 100%;
  border-radius: var(--radius-md);
  background: #000;
}

.gallery-video.portrait {
  width: 140px;
  max-width: 100%;
  border-radius: var(--radius-md);
  background: #000;
}

.gallery-video-placeholder {
  width: 140px;
  height: 248px;
  border-radius: var(--radius-md);
  background: var(--bg-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-align: center;
}

/* Overlay download button on each video */
.btn-dl-overlay {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 5;
}

.btn-dl-overlay:hover {
  background: var(--gold);
  color: #000;
  border-color: var(--gold);
  transform: scale(1.1);
}

.panel-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
}

/* Photo selection grid inside modal */
.modal-content .photo-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--space-sm);
}

.modal-content .photo-thumb {
  height: 120px;
}

.modal-content .photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ══════════════════════════════════════════════
   Projects List
   ══════════════════════════════════════════════ */
.projects-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.project-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) var(--space-xl);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-base);
  backdrop-filter: blur(10px);
}

.project-card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-gold);
  transform: translateY(-2px);
}

.project-card-name {
  font-size: 1.05rem;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-primary);
}

.project-card-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.project-card-date {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.project-card-actions {
  display: flex;
  gap: var(--space-sm);
}

/* ══════════════════════════════════════════════
   Toast Notifications
   ══════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toast {
  padding: var(--space-md) var(--space-xl);
  background: var(--bg-elevated);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.4s var(--ease-out);
  max-width: 380px;
  backdrop-filter: blur(20px);
}

.toast.success { border-color: rgba(52, 211, 153, 0.4); }
.toast.error { border-color: rgba(248, 113, 113, 0.4); }

@keyframes toastIn {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ══════════════════════════════════════════════
   Empty State
   ══════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: var(--space-3xl) var(--space-xl);
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  opacity: 0.4;
}

.empty-state-text {
  font-size: 0.9rem;
}

/* ══════════════════════════════════════════════
   Legacy class compat (old rooms, prompts —
   kept for any JS that still references them)
   ══════════════════════════════════════════════ */
.drop-zone { display: none; }
.room-card { display: none; }

/* ══════════════════════════════════════════════
   Responsive
   ══════════════════════════════════════════════ */
@media (max-width: 768px) {
  .app-header {
    padding: var(--space-md) var(--space-lg);
  }

  .app-main,
  .page-section {
    padding-left: var(--space-lg);
    padding-right: var(--space-lg);
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .gallery-previews {
    flex-direction: column;
  }

  .gallery-video.landscape {
    width: 100%;
  }

  .gallery-video.portrait {
    width: 100%;
    max-width: 200px;
  }

  .project-card {
    flex-direction: column;
    gap: var(--space-md);
    align-items: flex-start;
  }

  .photos-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  }

  .wizard-nav {
    padding: var(--space-lg) var(--space-md);
  }

  .step-label {
    display: none;
  }

  .panel-actions {
    flex-direction: column;
  }

  .panel-actions .btn-primary,
  .panel-actions .btn-secondary {
    width: 100%;
    justify-content: center;
  }
}

/* ══════════════════════════════════════════════
   Photo Gallery — Selectable Grid
   ══════════════════════════════════════════════ */
.gallery-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  padding: 8px 0;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.selection-count {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.photo-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.photo-gallery-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
}

.photo-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s;
}

.photo-gallery-item:hover {
  border-color: var(--border-light);
}

.photo-gallery-item:hover img {
  transform: scale(1.05);
}

.photo-gallery-item.selected {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold), 0 4px 16px rgba(212, 175, 55, 0.2);
}

.photo-gallery-item .select-overlay {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: transparent;
  transition: all 0.15s;
}

.photo-gallery-item.selected .select-overlay {
  background: var(--gold);
  border-color: var(--gold);
  color: #000;
}

.photo-gallery-item .photo-delete-btn {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(200, 30, 30, 0.7);
  border: none;
  color: #fff;
  font-size: 0.7rem;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.photo-gallery-item:hover .photo-delete-btn {
  display: flex;
}

.photo-gallery-item .photo-name-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 4px 6px;
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
  color: var(--text-secondary);
  font-size: 0.7rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ══════════════════════════════════════════════
   Step 1 Panel Actions (inline, not fixed)
   ══════════════════════════════════════════════ */
#step-1 .panel-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: var(--space-2xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-subtle);
}

/* ══════════════════════════════════════════════
   Project Sidebar
   ══════════════════════════════════════════════ */
.project-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 220px;
  z-index: 150;
  background: rgba(10, 10, 20, 0.92);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: var(--space-xl) 0;
  animation: sidebarIn 0.35s var(--ease-out);
}

@keyframes sidebarIn {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.sidebar-header {
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-md);
}

.sidebar-title {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.sidebar-project-name {
  display: block;
  margin-top: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  padding: 0 var(--space-sm);
}

.sidebar-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
  width: 100%;
}

.sidebar-btn:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
}

.sidebar-btn.active {
  background: var(--gold-dim);
  color: var(--gold);
}

.sidebar-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.sidebar-btn-accent {
  background: var(--gold-dim);
  color: var(--gold);
  font-weight: 700;
}

.sidebar-btn-accent:hover:not(:disabled) {
  background: rgba(212, 168, 83, 0.2);
  color: var(--gold-light);
}

.sidebar-btn-muted {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.sidebar-icon {
  font-size: 1rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 8px 12px;
}

#step-3 {
  padding-bottom: 40px;
}

/* ══════════════════════════════════════════════
   Modal — Add Video Popup
   ══════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modalFadeIn 0.25s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  width: 90%;
  max-width: 640px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6), 0 0 40px rgba(212, 175, 55, 0.08);
  animation: modalSlideUp 0.3s ease-out;
}

.modal-content.modal-lg {
  max-width: 800px;
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-header h2 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--gold);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.75rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 8px;
  transition: all 0.2s;
}

.modal-close:hover {
  color: var(--text-primary);
  background: var(--bg-glass-hover);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-body .upload-zone {
  margin-bottom: 16px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ══════════════════════════════════════════════
   GSAP Animation Helpers
   ══════════════════════════════════════════════ */
.gsap-hidden {
  opacity: 0;
  transform: translateY(20px);
}

/* ══════════════════════════════════════════════
   Images Modal Grid
   ══════════════════════════════════════════════ */
.images-modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-top: var(--space-lg);
}

.images-modal-grid .img-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  transition: all 0.2s;
}

.images-modal-grid .img-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.images-modal-grid .img-thumb:hover {
  border-color: var(--gold);
  box-shadow: var(--shadow-gold);
}

.images-modal-grid .img-thumb .img-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(200, 30, 30, 0.8);
  border: none;
  color: #fff;
  font-size: 0.65rem;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
}

.images-modal-grid .img-thumb:hover .img-delete {
  display: flex;
}

.images-modal-grid .img-thumb .img-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 3px 6px;
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
  color: var(--text-secondary);
  font-size: 0.6rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.images-modal-count {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ══════════════════════════════════════════════
   Responsive — Sidebar
   ══════════════════════════════════════════════ */
@media (max-width: 768px) {
  .project-sidebar {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    flex-direction: row;
    padding: var(--space-sm) 0;
    border-right: none;
    border-top: 1px solid var(--border-subtle);
  }

  .sidebar-header { display: none; }
  .sidebar-divider { display: none; }

  .sidebar-nav {
    flex-direction: row;
    overflow-x: auto;
    gap: 0;
    padding: 0 var(--space-sm);
  }

  .sidebar-btn {
    flex-direction: column;
    gap: 2px;
    padding: 8px 12px;
    font-size: 0.65rem;
    min-width: 60px;
    text-align: center;
    justify-content: center;
  }

  .sidebar-icon { font-size: 1.1rem; }

  body.sidebar-active .app-main,
  body.sidebar-active .wizard-nav {
    margin-left: 0;
    padding-bottom: 80px;
  }
}

/* ══════════════════════════════════════════════════════════
   Montage UI
   ══════════════════════════════════════════════════════════ */

.btn-montage {
  background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
  border-color: rgba(99, 102, 241, 0.4) !important;
}
.btn-montage:hover {
  background: linear-gradient(135deg, #818cf8, #a78bfa) !important;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.3) !important;
}

/* Montage clips grid */
.montage-clips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.montage-clip-card {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid var(--border-subtle);
  transition: all 0.2s ease;
  aspect-ratio: 16/9;
}
.montage-clip-card:hover {
  border-color: var(--border-medium);
  transform: translateY(-2px);
}
.montage-clip-card.selected {
  border-color: var(--gold);
  box-shadow: 0 0 16px var(--gold-glow);
}
.montage-clip-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.montage-clip-card .clip-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  border: 2px solid rgba(255,255,255,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.2s ease;
}
.montage-clip-card.selected .clip-check {
  background: var(--gold);
  border-color: var(--gold-light);
  color: #000;
}
.montage-clip-card .clip-order {
  position: absolute;
  bottom: 6px;
  left: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gold);
  color: #000;
  font-size: 11px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
}
.montage-clip-card.selected .clip-order {
  display: flex;
}

.montage-hint {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 4px;
}

/* Montage steps */
.montage-step h3 {
  font-family: var(--font-display);
  color: var(--text-primary);
  margin-bottom: 8px;
  font-size: 1rem;
}
.montage-step + .montage-step {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
}

/* Music options */
.montage-setting-group {
  margin-bottom: 20px;
}
.montage-setting-group > label {
  display: block;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.music-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 10px;
}
.music-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 10px;
  border-radius: 12px;
  background: var(--bg-glass);
  border: 2px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}
.music-option input { display: none; }
.music-option:hover { border-color: var(--border-medium); background: var(--bg-glass-hover); }
.music-option.selected {
  border-color: var(--gold);
  background: var(--gold-dim);
}
.music-icon { font-size: 1.5rem; }
.music-name { font-weight: 600; color: var(--text-primary); font-size: 0.8rem; }
.music-desc { color: var(--text-secondary); font-size: 0.7rem; }

/* Ratio toggle */
.ratio-toggle {
  display: flex;
  gap: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}
.ratio-btn {
  flex: 1;
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--bg-glass);
  color: var(--text-secondary);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}
.ratio-btn.active {
  background: var(--gold);
  color: #000;
}
.ratio-btn:hover:not(.active) {
  background: var(--bg-glass-hover);
}

/* Montage progress */
.montage-progress {
  text-align: center;
  padding: 40px 20px;
}
.montage-progress-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  animation: pulse 1.5s ease-in-out infinite;
}
.montage-progress h3 {
  color: var(--text-primary);
  margin-bottom: 8px;
  font-family: var(--font-display);
}
.montage-progress p {
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.progress-bar-container {
  width: 100%;
  max-width: 400px;
  height: 6px;
  background: var(--bg-glass);
  border-radius: 3px;
  margin: 0 auto;
  overflow: hidden;
}
.progress-bar {
  width: 0%;
  height: 100%;
  background: var(--gradient-gold);
  border-radius: 3px;
  transition: width 0.5s ease;
}
.progress-bar.indeterminate {
  width: 30%;
  animation: progress-indeterminate 1.5s ease-in-out infinite;
}

@keyframes progress-indeterminate {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* Montages Section */
.montages-header {
  margin-top: 32px;
  margin-bottom: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
}
.montages-header h3 {
  font-family: var(--font-display);
  color: var(--text-primary);
  font-size: 1.1rem;
}
.montages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.montage-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  overflow: hidden;
  transition: all 0.2s ease;
}
.montage-card:hover {
  border-color: var(--border-medium);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.montage-card video {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: contain;
  background: #000;
}
.montage-card-info {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.montage-card-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.montage-card-badge {
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.montage-card-badge.done {
  background: rgba(52, 211, 153, 0.15);
  color: var(--accent-green);
}
.montage-card-badge.rendering {
  background: rgba(74, 158, 255, 0.15);
  color: var(--accent-blue);
}
.montage-card-badge.failed {
  background: rgba(248, 113, 113, 0.15);
  color: var(--accent-red);
}
.montage-download-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 4px;
  transition: color 0.2s ease;
}
.montage-download-btn:hover {
  color: var(--gold);
}
