/* ═══════════════════════════════════════════════
   EAG CREATIVE BRIEF GENERATOR — STYLES
   ═══════════════════════════════════════════════ */

:root {
  --green-darkest: #0F1E0F;
  --green-dark: #1B4332;
  --green-mid: #3A6B4C;
  --green-light: #5B8F6B;
  --green-pale: #E8F0EA;
  --orange: #E8651A;
  --orange-hover: #FF7A2E;
  --orange-pale: #FFF3EC;
  --cream: #FAF8F4;
  --warm-white: #F5F2EB;
  --border: #D4CFC6;
  --border-light: #E8E4DD;
  --text: #1A1A1A;
  --text-secondary: #6B7280;
  --text-muted: #9CA3AF;
  --white: #FFFFFF;
  --red: #DC2626;
  --red-pale: #FEF2F2;
  --yellow: #D97706;
  --yellow-pale: #FFFBEB;
  --blue: #2563EB;
  --blue-pale: #EFF6FF;
  --purple: #7C3AED;
  --purple-pale: #F5F3FF;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --radius: 8px;
  --radius-lg: 12px;
}

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

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--cream);
  color: var(--text);
  line-height: 1.5;
}

/* ═══════════ LOGIN ═══════════ */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--green-darkest);
}
.login-card {
  background: var(--white);
  padding: 48px;
  border-radius: var(--radius-lg);
  text-align: center;
  max-width: 400px;
  width: 90%;
  box-shadow: var(--shadow-lg);
}
.login-logo {
  font-size: 48px;
  font-weight: 800;
  color: var(--green-dark);
  letter-spacing: -2px;
  margin-bottom: 8px;
}
.login-card h1 { font-size: 20px; color: var(--text); margin-bottom: 8px; }
.login-card p { color: var(--text-secondary); margin-bottom: 24px; font-size: 14px; }
.error-msg { color: var(--red); font-size: 13px; margin-top: 12px; }

/* ═══════════ BUTTONS ═══════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--orange); color: var(--white); }
.btn-primary:hover:not(:disabled) { background: var(--orange-hover); }
.btn-secondary { background: var(--green-dark); color: var(--white); }
.btn-secondary:hover:not(:disabled) { background: var(--green-mid); }
.btn-outline { background: var(--white); color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover:not(:disabled) { background: var(--warm-white); border-color: var(--green-mid); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text); background: var(--warm-white); }
.btn-danger { background: var(--red); color: var(--white); }
.btn-danger:hover:not(:disabled) { background: #B91C1C; }
.btn-lg { padding: 12px 24px; font-size: 16px; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-icon { padding: 6px; width: 32px; height: 32px; justify-content: center; }

/* ═══════════ NAVIGATION ═══════════ */
.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 24px;
  background: var(--green-darkest);
  border-bottom: 3px solid var(--orange);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-logo {
  font-size: 24px;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -1px;
  margin-right: 24px;
}
.nav-btn {
  padding: 8px 16px;
  background: transparent;
  color: rgba(255,255,255,0.6);
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.nav-btn:hover { color: var(--white); background: rgba(255,255,255,0.1); }
.nav-btn.active { color: var(--white); background: rgba(255,255,255,0.15); }
.nav-spacer { flex: 1; }
.nav-user { color: rgba(255,255,255,0.5); font-size: 13px; margin-right: 8px; }
.nav-logout { color: rgba(255,255,255,0.4); font-size: 13px; }

/* ═══════════ LAYOUT ═══════════ */
.content { max-width: 1200px; margin: 0 auto; padding: 32px 24px; }
.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 28px; font-weight: 700; color: var(--green-darkest); }
.page-header p { color: var(--text-secondary); margin-top: 4px; }

/* ═══════════ CARDS ═══════════ */
.card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
}
.card-header h2 { font-size: 16px; font-weight: 700; color: var(--green-darkest); }
.card-body { padding: 20px; }

/* ═══════════ FORMS ═══════════ */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.form-label .required { color: var(--red); }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--green-mid);
  box-shadow: 0 0 0 3px var(--green-pale);
}
.form-textarea { resize: vertical; min-height: 80px; }
.form-help { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ═══════════ COLOR SWATCHES ═══════════ */
.color-input-row { display: flex; align-items: center; gap: 8px; }
.color-swatch-input {
  width: 40px; height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2px;
  cursor: pointer;
  background: var(--white);
}
.color-hex-input { flex: 1; }

/* ═══════════ SEARCH ═══════════ */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.search-bar .form-input { flex: 1; }

/* ═══════════ CLIENT LIST ═══════════ */
.client-list { display: flex; flex-direction: column; gap: 2px; }
.client-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.1s;
}
.client-row:hover { background: var(--warm-white); }
.client-row.active { background: var(--green-pale); }
.client-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--white); font-weight: 700; font-size: 14px;
  flex-shrink: 0;
}
.client-info { flex: 1; min-width: 0; }
.client-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-meta { font-size: 12px; color: var(--text-muted); }
.client-actions { display: flex; gap: 4px; }

/* ═══════════ BRAND DETAIL ═══════════ */
.brand-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 768px) { .brand-detail-grid { grid-template-columns: 1fr; } }
.brand-section { margin-bottom: 24px; }
.brand-section-title { font-size: 14px; font-weight: 700; color: var(--green-dark); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.brand-color-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.brand-swatch {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  position: relative;
}
.brand-swatch-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; text-align: center; }

/* ═══════════ BRIEF STEPS ═══════════ */
.steps-bar {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 32px;
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  overflow: hidden;
}
.step-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  border-right: 1px solid var(--border-light);
  transition: all 0.15s;
}
.step-item:last-child { border-right: none; }
.step-item.active { background: var(--green-pale); color: var(--green-dark); }
.step-item.completed { color: var(--green-mid); }
.step-num {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  background: var(--border-light);
  color: var(--text-muted);
  flex-shrink: 0;
}
.step-item.active .step-num { background: var(--green-dark); color: var(--white); }
.step-item.completed .step-num { background: var(--green-mid); color: var(--white); }

/* ═══════════ BRIEF TYPE CARDS ═══════════ */
.brief-type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.brief-type-card {
  padding: 20px;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--white);
  cursor: pointer;
  transition: all 0.15s;
}
.brief-type-card:hover { border-color: var(--green-mid); background: var(--green-pale); }
.brief-type-card.selected { border-color: var(--orange); background: var(--orange-pale); }
.brief-type-card h3 { font-size: 16px; font-weight: 700; color: var(--green-darkest); margin-bottom: 4px; }
.brief-type-card p { font-size: 13px; color: var(--text-secondary); }

/* ═══════════ MODE TOGGLE ═══════════ */
.mode-toggle {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}
.mode-option {
  flex: 1;
  padding: 16px;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.15s;
  background: var(--white);
}
.mode-option:hover { border-color: var(--green-mid); }
.mode-option.selected { border-color: var(--orange); background: var(--orange-pale); }
.mode-option h4 { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.mode-option p { font-size: 12px; color: var(--text-secondary); }

/* ═══════════ SOURCE INPUT ═══════════ */
.source-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  background: var(--warm-white);
  margin-bottom: 16px;
  transition: border-color 0.15s;
}
.source-area:hover { border-color: var(--green-mid); }
.source-area.dragover { border-color: var(--orange); background: var(--orange-pale); }
.source-area p { color: var(--text-secondary); font-size: 14px; }

/* ═══════════ EXTRACTION PROGRESS ═══════════ */
.extraction-progress {
  padding: 32px;
  text-align: center;
}
.extraction-progress .spinner {
  width: 48px; height: 48px;
  border: 4px solid var(--border-light);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.extraction-progress h3 { font-size: 18px; margin-bottom: 8px; }
.extraction-progress p { color: var(--text-secondary); }

/* ═══════════ REVIEW FIELDS ═══════════ */
.field-section {
  margin-bottom: 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.field-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--green-dark);
  color: var(--white);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}
.field-section-header:hover { background: var(--green-mid); }
.field-section-toggle { font-size: 12px; }
.field-section-body { padding: 0; }
.field-section-body.collapsed { display: none; }

.field-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light);
}
.field-row:last-child { border-bottom: none; }
.field-row:hover { background: var(--warm-white); }

.field-confidence {
  width: 20px; height: 20px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
  margin-top: 2px;
}
.conf-high { background: var(--green-pale); color: var(--green-mid); }
.conf-medium { background: var(--yellow-pale); color: var(--yellow); }
.conf-low { background: var(--orange-pale); color: var(--orange); }
.conf-missing { background: var(--red-pale); color: var(--red); }
.conf-database { background: var(--purple-pale); color: var(--purple); }

.field-label {
  width: 180px; min-width: 180px;
  font-size: 13px; font-weight: 600;
  color: var(--green-dark);
  padding-top: 2px;
}
.field-label .required-dot { color: var(--red); }
.field-value { flex: 1; min-width: 0; }
.field-value .form-input,
.field-value .form-textarea,
.field-value .form-select { font-size: 13px; }
.field-note { font-size: 11px; color: var(--text-muted); font-style: italic; margin-top: 2px; }

/* ═══════════ EXPORT PANEL ═══════════ */
.export-panel { text-align: center; padding: 40px 20px; }
.export-panel h2 { font-size: 24px; margin-bottom: 8px; }
.export-panel p { color: var(--text-secondary); margin-bottom: 24px; }
.export-warnings { margin-bottom: 24px; text-align: left; }
.export-warning {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--yellow-pale);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--yellow);
  margin-bottom: 4px;
}
.export-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 24px;
}
.export-success .check {
  width: 64px; height: 64px;
  background: var(--green-pale);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
  color: var(--green-mid);
}

/* ═══════════ STATS BAR ═══════════ */
.stats-bar {
  display: flex;
  gap: 16px;
  padding: 12px 16px;
  background: var(--warm-white);
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 13px;
}
.stat-item { display: flex; align-items: center; gap: 6px; }
.stat-dot { width: 8px; height: 8px; border-radius: 50%; }

/* ═══════════ LOGO UPLOADS ═══════════ */
.logo-grid { display: flex; gap: 12px; flex-wrap: wrap; }
.logo-thumb {
  width: 80px; height: 80px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  background: var(--warm-white);
}
.logo-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-thumb .remove-logo {
  position: absolute; top: 2px; right: 2px;
  width: 18px; height: 18px;
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: 50%;
  font-size: 10px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
}
.logo-thumb:hover .remove-logo { display: flex; }
.logo-name { font-size: 10px; color: var(--text-muted); text-align: center; margin-top: 2px; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ═══════════ MODAL ═══════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
}
.modal-card h2 { font-size: 18px; margin-bottom: 16px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* ═══════════ TOAST ═══════════ */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--green-dark);
  color: var(--white);
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 300;
  animation: slideIn 0.3s ease;
}
.toast.error { background: var(--red); }
@keyframes slideIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ═══════════ TWO-COLUMN LAYOUT ═══════════ */
.two-col { display: grid; grid-template-columns: 320px 1fr; gap: 24px; min-height: calc(100vh - 120px); }
.two-col .sidebar { }
.two-col .main { }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

/* ═══════════ EMPTY STATE ═══════════ */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state h3 { font-size: 16px; color: var(--text-secondary); margin-bottom: 4px; }
.empty-state p { font-size: 13px; }

/* ═══════════ SCROLLBAR ═══════════ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ═══════════ ACCENT COLORS FLEX ═══════════ */
.accent-colors-list { display: flex; flex-direction: column; gap: 8px; }
.accent-color-row { display: flex; align-items: center; gap: 8px; }
.accent-color-row .btn-icon { flex-shrink: 0; }
