/* webfaCeMEdia Brand Lab — app.css */
:root {
  --accent: #6366f1;
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.04);
  --shadow-lg: 0 4px 24px rgba(0,0,0,.1);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background .5s ease, --accent .5s ease;
}

/* Header */
.brand-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.logomark {
  width: 44px;
  height: 44px;
  border-radius: 10px;
}

.header-text h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header-sub {
  font-size: .85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Container */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* Brief Form */
.brief-section {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  margin-bottom: 32px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

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

.form-group label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .95rem;
  font-family: inherit;
  transition: border-color .2s;
  outline: none;
}

.form-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: .95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity .2s, transform .1s;
}

.btn-primary:hover { opacity: .9; }
.btn-primary:active { transform: scale(.98); }

.btn-iterate {
  padding: 8px 16px;
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .85rem;
  font-family: inherit;
  cursor: pointer;
  transition: all .2s;
}

.btn-iterate:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--shadow);
}

.btn-save {
  padding: 6px 14px;
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: 6px;
  font-size: .8rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all .2s;
}

.btn-save:hover {
  background: var(--accent);
  color: #fff;
}

.btn-delete {
  padding: 6px 12px;
  background: #ef4444;
  color: #fff;
  border: 1.5px solid #ef4444;
  border-radius: 6px;
  font-size: .8rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all .2s;
}

.btn-delete:hover {
  background: #dc2626;
  border-color: #dc2626;
}

.btn-delete-small {
  padding: 4px 8px;
  background: transparent;
  color: #ef4444;
  border: 1px solid #ef4444;
  border-radius: 6px;
  font-size: .85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all .2s;
  margin-left: auto;
  line-height: 1;
}

.btn-delete-small:hover {
  background: #ef4444;
  color: #fff;
}

.btn-sm {
  padding: 5px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .8rem;
  font-family: inherit;
  cursor: pointer;
  transition: all .2s;
}

.btn-sm:hover { border-color: var(--accent); }

/* Brand Board */
.brand-board {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  margin-bottom: 40px;
}

.board-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 28px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.board-header h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
}

.industry-tag, .vibes-tag {
  padding: 3px 10px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent);
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
}

.brand-section {
  padding: 24px 28px;
  border-bottom: 1px solid var(--border);
}

.brand-section:last-child { border-bottom: none; }

.brand-section h3 {
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* Wordmark */
.wordmark-display .wordmark-text {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 8px;
}

.tagline {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.font-pairing {
  display: flex;
  gap: 16px;
}

.font-label {
  font-size: .75rem;
  color: var(--text-muted);
  padding: 3px 8px;
  background: var(--bg);
  border-radius: 4px;
}

/* Palette */
.swatches {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.swatch {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  box-shadow: var(--shadow);
  transition: transform .2s;
  cursor: pointer;
}

.swatch:hover { transform: scale(1.08); }

.swatch-label {
  font-size: .65rem;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
  padding: 2px 6px;
  background: rgba(0,0,0,.3);
  border-radius: 4px;
  margin-bottom: 6px;
}

.iterate-palette { display: flex; gap: 8px; }

/* Images */
.brand-visual {
  padding: 24px 28px;
  border-bottom: 1px solid var(--border);
}

.brand-visual img {
  max-width: 100%;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

/* Iterate Controls */
.iterate-controls {
  padding: 20px 28px;
  border-bottom: 1px solid var(--border);
}

.iterate-controls h3 {
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.iterate-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Critique */
.critique-section {
  padding: 24px 28px;
}

.critique-content {
  font-size: .9rem;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
}

/* Loading */
.loading-card {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading {
  color: var(--text-muted);
  font-size: .85rem;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: .5; }
  50% { opacity: 1; }
}

/* Concept Stream */
.concept-stream {
  min-height: 60px;
  font-size: .9rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

/* History */
.history-section {
  margin-top: 48px;
}

.history-section h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border-radius: 8px;
  box-shadow: var(--shadow);
  font-size: .9rem;
}

.history-name {
  font-weight: 600;
  min-width: 120px;
}

.history-industry {
  color: var(--text-muted);
  font-size: .8rem;
}

.history-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.history-date {
  margin-left: auto;
  font-size: .75rem;
  color: var(--text-muted);
}

.save-confirmation {
  color: #10b981;
  font-size: .8rem;
  font-weight: 600;
}

/* Load button */
.btn-load {
  padding: 4px 10px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: .75rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all .2s;
  flex-shrink: 0;
}

.btn-load:hover {
  opacity: .85;
}

/* Concept text (rendered from saved stream) */
.concept-text {
  font-size: .9rem;
  line-height: 1.6;
  white-space: pre-wrap;
  color: var(--text);
}

/* Error */
.error {
  color: #ef4444;
  font-size: .85rem;
}

/* Responsive */
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .iterate-buttons { flex-direction: column; }
  .wordmark-display .wordmark-text { font-size: 2rem; }
  .board-header { flex-direction: column; align-items: flex-start; }
  .swatch { width: 56px; height: 56px; }
}