/* Imprint by Alterspective — Brand Styles */

:root {
  --brand-primary: #1a1a2e;
  --brand-accent: #c7354d;
  --brand-secondary: #16213e;
  --brand-light: #f5f5f7;
  --brand-white: #ffffff;
  --brand-text: #1a1a2e;
  --brand-muted: #4b5563;
  --brand-border: #e5e7eb;
  --brand-success: #10b981;
  --brand-warning: #f59e0b;
  --brand-error: #ef4444;
  --brand-info: #3b82f6;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', monospace;
  --max-width: 1200px;
}

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

body {
  font-family: var(--font);
  color: var(--brand-text);
  background: var(--brand-light);
  line-height: 1.6;
  min-height: 100vh;
}

/* Layout */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }
.page { padding: 32px 0; }

/* Header */
.header {
  background: var(--brand-primary);
  color: var(--brand-white);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-lg);
}
.header .container { display: flex; align-items: center; justify-content: space-between; }
.header-brand { font-size: 20px; font-weight: 700; text-decoration: none; color: var(--brand-white); }
.header-brand span { color: var(--brand-accent); }
.header-nav { display: flex; gap: 16px; align-items: center; }
.header-nav a,
.header-nav button.nav-link {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-size: 14px;
  padding: 10px 16px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius);
  transition: all 0.2s;
  background: none;
  border: none;
  font-family: var(--font);
  cursor: pointer;
}
.header-nav a:hover,
.header-nav button.nav-link:hover { color: var(--brand-white); background: rgba(255,255,255,0.1); }
.header-nav a.active,
.header-nav button.nav-link.active { color: var(--brand-white); background: rgba(255,255,255,0.15); }

/* Cards */
.card {
  background: var(--brand-white);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--brand-border);
}
.card + .card { margin-top: 16px; }
.card-header { font-size: 18px; font-weight: 600; margin-bottom: 16px; }

/* Forms */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; color: var(--brand-text); }
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--brand-border);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 14px;
  transition: border-color 0.2s;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px rgba(199, 53, 77, 0.1);
}
.form-group textarea { resize: vertical; min-height: 100px; }
.form-group .hint { font-size: 12px; color: var(--brand-muted); margin-top: 4px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.btn-primary { background: var(--brand-accent); color: var(--brand-white); }
.btn-primary:hover { background: #a82d42; }
.btn-secondary { background: var(--brand-secondary); color: var(--brand-white); }
.btn-secondary:hover { background: #0f1a2e; }
.btn-outline { background: transparent; color: var(--brand-text); border: 1px solid var(--brand-border); }
.btn-outline:hover { background: var(--brand-light); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-full { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-success { background: var(--brand-success); color: var(--brand-white); }
.btn-danger { background: var(--brand-error); color: var(--brand-white); }

/* Grid */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 24px; }
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* Split pane */
.split-pane { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; min-height: 600px; }
.split-pane > * { overflow-y: auto; }
@media (max-width: 900px) { .split-pane { grid-template-columns: 1fr; } }

/* Progress bar */
.progress-bar { background: var(--brand-border); border-radius: 4px; height: 8px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--brand-accent); border-radius: 4px; transition: width 0.3s; }

/* Chat */
.chat-container { display: flex; flex-direction: column; height: calc(100vh - 200px); }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px 0; }
.chat-message { display: flex; gap: 12px; margin-bottom: 16px; }
.chat-message.user { flex-direction: row-reverse; }
.chat-bubble {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  line-height: 1.5;
}
.chat-message.user .chat-bubble { background: var(--brand-accent); color: var(--brand-white); }
.chat-message.assistant .chat-bubble { background: var(--brand-white); border: 1px solid var(--brand-border); }
.chat-input-row { display: flex; gap: 12px; padding: 16px 0; border-top: 1px solid var(--brand-border); }
.chat-input-row input { flex: 1; }

/* Suggestion card */
.suggestion-card {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius);
  padding: 12px 16px;
  margin: 8px 0;
}
.suggestion-card .field { font-weight: 600; color: var(--brand-primary); font-size: 13px; margin-bottom: 4px; }
.suggestion-card .old-value { color: var(--brand-muted); text-decoration: line-through; font-size: 13px; }
.suggestion-card .new-value { color: var(--brand-text); font-size: 14px; margin: 4px 0; }
.suggestion-card .reason { color: var(--brand-muted); font-size: 12px; font-style: italic; }
.suggestion-card .actions { display: flex; gap: 8px; margin-top: 8px; }

/* Export cards */
.export-card {
  background: var(--brand-white);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  transition: all 0.2s;
}
.export-card:hover { border-color: var(--brand-accent); box-shadow: var(--shadow-lg); }
.export-card .name { font-weight: 600; font-size: 16px; margin-bottom: 4px; }
.export-card .desc { font-size: 13px; color: var(--brand-muted); margin-bottom: 12px; }

/* Code block */
.code-block {
  background: var(--brand-primary);
  color: #e5e7eb;
  padding: 16px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 13px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Preview */
.preview-pane {
  background: var(--brand-white);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  font-size: 14px;
}
.preview-pane h2 { font-size: 18px; margin-bottom: 12px; }
.preview-pane h3 { font-size: 15px; margin: 16px 0 8px; color: var(--brand-secondary); }
.preview-pane p { margin-bottom: 8px; }

/* Badges */
.badge {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-approved { background: #d1fae5; color: #065f46; }
.badge-success { background: #d1fae5; color: #065f46; }

/* Auto-save indicator */
.auto-save {
  font-size: 12px;
  color: var(--brand-success);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Hero section */
.hero {
  text-align: center;
  padding: 80px 0 60px;
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
  color: var(--brand-white);
}
.hero h1 { font-size: 48px; font-weight: 700; margin-bottom: 16px; }
.hero h1 span { color: var(--brand-accent); }
.hero .tagline { font-size: 20px; color: rgba(255,255,255,0.8); margin-bottom: 32px; max-width: 600px; margin-left: auto; margin-right: auto; }

/* Features grid */
.feature-card { text-align: center; padding: 32px 24px; }
.feature-card .icon { font-size: 32px; margin-bottom: 12px; }
.feature-card h2, .feature-card h3 { font-size: 18px; margin-bottom: 8px; }
.feature-card p { font-size: 14px; color: var(--brand-muted); }

/* Utilities */
.text-center { text-align: center; }
.text-muted { color: var(--brand-muted); }
.text-sm { font-size: 13px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.gap-2 { gap: 16px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.hidden { display: none !important; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 14px; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--brand-border); margin-bottom: 20px; }
.tab {
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--brand-muted);
  border-bottom: 2px solid transparent;
  font-family: var(--font);
}
.tab.active { color: var(--brand-accent); border-bottom-color: var(--brand-accent); }
.tab:hover { color: var(--brand-text); }

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--brand-border);
  border-top-color: var(--brand-accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Dashboard stats */
.stat-card { text-align: center; }
.stat-card .value { font-size: 36px; font-weight: 700; color: var(--brand-accent); }
.stat-card .label { font-size: 14px; color: var(--brand-muted); }

/* Skip navigation link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--brand-accent);
  color: white;
  padding: 8px 16px;
  z-index: 100;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 0;
}

/* Focus indicators for all interactive elements */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 2px;
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .spinner {
    animation: none;
    border: 3px solid var(--brand-accent);
  }
}
