/* Janus — Creative Intelligence Platform */

:root {
  --bg: #F7F7F5;
  --surface: #FFFFFF;
  --text: #1C1C1C;
  --text-muted: #737373;
  --text-light: #A3A3A3;
  --accent: #1A56DB;
  --accent-hover: #1544B5;
  --border: #E5E5E0;
  --success: #16A34A;
  --success-bg: #F0FDF4;
  --danger: #DC2626;
  --danger-bg: #FEF2F2;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
}

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

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* --- Navigation --- */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 48px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.nav-logo {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.nav-links a:hover { color: var(--text); }

/* --- Hero / Landing --- */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: calc(100vh - 200px);
  padding: 80px 24px;
}

.hero-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.hero h1 {
  font-size: 56px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  max-width: 680px;
  margin-bottom: 24px;
}

.hero p {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 480px;
  line-height: 1.7;
  margin-bottom: 48px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  align-items: center;
}

/* --- Buttons --- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
}

.btn-primary {
  background: var(--text);
  color: var(--surface);
}

.btn-primary:hover { background: #333; }

.btn-secondary {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  color: var(--text);
  border-color: var(--text-light);
}

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

.btn-accent:hover { background: var(--accent-hover); }

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}

.btn-danger:hover {
  background: var(--danger-bg);
}

/* --- Container --- */

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

/* --- Dashboard --- */

.page-header {
  padding: 48px 0 32px;
}

.page-header h1 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-header p {
  font-size: 15px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Brand cards */

.brand-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 64px;
}

.brand-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  box-shadow: var(--shadow);
  transition: border-color 0.15s;
}

.brand-card:hover { border-color: var(--text-light); }

.brand-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.brand-name {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand-slug {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 2px;
}

.brand-meta {
  font-size: 12px;
  color: var(--text-light);
  text-align: right;
}

.connections-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.brand-actions {
  display: flex;
  gap: 10px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  margin-top: 20px;
}

/* --- Sync button (prominent) --- */

.btn-sync {
  padding: 10px 28px;
  font-size: 14px;
  font-weight: 600;
}

.sync-area {
  margin-bottom: 0;
}

.last-sync-text {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}

/* --- Sync progress bar --- */

.sync-progress {
  width: 100%;
}

.sync-progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}

.sync-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.4s ease;
  min-width: 1%;
}

.sync-progress-fill.complete { background: var(--success); }
.sync-progress-fill.error { background: var(--danger); }

.sync-progress-text {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1;
}

.sync-progress-text a {
  color: var(--danger);
  cursor: pointer;
  text-decoration: underline;
}

/* --- Disconnect icon (small, subtle) --- */

.disconnect-icon {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: var(--text-light);
  padding: 4px 6px;
  border-radius: 4px;
  transition: all 0.15s;
  line-height: 1;
  opacity: 0.4;
  flex-shrink: 0;
}

.disconnect-icon:hover {
  color: var(--danger);
  background: var(--danger-bg);
  opacity: 1;
}

/* --- Disconnect confirmation modal --- */

.disconnect-confirm-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  box-sizing: border-box;
  margin-bottom: 16px;
}

.disconnect-confirm-input:focus {
  outline: none;
  border-color: var(--danger);
}

.disconnect-warning {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: var(--danger-bg);
  border: 1px solid #FECACA;
  border-radius: 6px;
}

.btn-disconnect-confirm {
  opacity: 0.4;
  pointer-events: none;
  transition: opacity 0.3s;
}

.btn-disconnect-confirm.active {
  opacity: 1;
  pointer-events: auto;
}

/* --- Insights panel --- */

.insights-panel {
  margin-top: 20px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

.insights-panel h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
}

.insights-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.insights-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.insights-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.insights-table tr:last-child td { border-bottom: none; }

.insights-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
}

/* --- Alerts --- */

.alert {
  padding: 14px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 24px;
}

.alert-success {
  background: var(--success-bg);
  color: #166534;
  border: 1px solid #BBF7D0;
}

.alert-error {
  background: var(--danger-bg);
  color: #991B1B;
  border: 1px solid #FECACA;
}

/* --- Loading --- */

.loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 14px;
  padding: 40px 0;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* --- Empty state --- */

.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-muted);
}

.empty-state h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 15px;
  max-width: 400px;
  margin: 0 auto 24px;
}

/* --- Privacy / Legal --- */

.legal {
  padding: 48px 0 80px;
}

.legal h1 {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.legal .last-updated {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 48px;
}

.legal h2 {
  font-size: 20px;
  font-weight: 600;
  margin: 40px 0 12px;
  letter-spacing: -0.01em;
}

.legal p, .legal li {
  font-size: 15px;
  color: #404040;
  line-height: 1.75;
  margin-bottom: 12px;
}

.legal ul {
  padding-left: 24px;
  margin-bottom: 16px;
}

.legal li { margin-bottom: 6px; }

/* --- Footer --- */

.footer {
  padding: 32px 48px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 13px;
  color: var(--text-light);
}

/* --- Tabs --- */

.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.tab {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-family: inherit;
  transition: all 0.15s;
}

.tab:hover { color: var(--text); }
.tab.active {
  color: var(--text);
  border-bottom-color: var(--text);
}

/* --- Back link --- */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 24px;
}

.back-link:hover { color: var(--text); }

/* --- Date selector --- */

.date-selector {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 20px;
}

.date-selector label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.date-selector select {
  font-family: inherit;
  font-size: 13px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
