/* ===========================================================
   AFRIASSIST — Design System
   Premium, calm, intelligent. Not "AI purple gradient everywhere".
=========================================================== */

:root {
  /* Warm ivory ground instead of flat #fff — reads premium, not clinical */
  --bg: #fbfaf8;
  --surface: #ffffff;
  --surface-2: #f4f2ee;
  --border: rgba(20, 16, 12, 0.08);
  --border-strong: rgba(20, 16, 12, 0.14);
  --text: #1a1712;
  --text-dim: #6b665e;
  --text-faint: #9a958a;
  --accent: #e0631f; /* AFRISTACK accent — warm ember, darkened for AA contrast on white */
  --accent-dim: rgba(224, 99, 31, 0.10);
  --accent-strong: #c8541a;
  --success: #1f9d6b;
  --warn: #b8790a;
  --danger: #d13b3b;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 32px rgba(20, 16, 12, 0.07);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body { line-height: 1.5; font-size: 16px; }

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--accent);
  color: #14100c;
}
.btn-primary:hover { background: var(--accent-strong); }

.btn-secondary {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-secondary:hover { border-color: var(--text-dim); }

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
}
.btn-ghost:hover { color: var(--text); }

.btn-block { width: 100%; }
.btn-lg { padding: 16px 26px; font-size: 16px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 250, 248, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.logo-mark {
  width: 30px;
  height: 30px;
  display: block;
  flex-shrink: 0;
}
.nav-links {
  display: flex;
  gap: 32px;
  align-items: center;
}
.nav-links a {
  color: var(--text-dim);
  font-size: 14.5px;
  font-weight: 500;
  transition: color 0.15s ease;
}
.nav-links a:hover { color: var(--text); }
.nav-cta { display: flex; gap: 12px; align-items: center; }

/* ---------- Hero ---------- */
.hero {
  padding: 110px 0 90px;
  text-align: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 28px;
}
.hero h1 {
  font-size: clamp(38px, 6vw, 64px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.06;
  max-width: 820px;
  margin: 0 auto 24px;
}
.hero h1 span { color: var(--text-faint); }
.hero p {
  color: var(--text-dim);
  font-size: 18px;
  max-width: 560px;
  margin: 0 auto 40px;
}
.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.hero-note { color: var(--text-faint); font-size: 13.5px; }

/* ---------- Prompt mock ---------- */
.prompt-mock {
  max-width: 640px;
  margin: 64px auto 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow);
  text-align: left;
}
.prompt-mock .pm-label {
  color: var(--text-faint);
  font-size: 12.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}
.pm-input {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}
.pm-input span { color: var(--text-dim); font-size: 15px; }
.pm-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.6s infinite ease-in-out;
  flex-shrink: 0;
}
@keyframes pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* ---------- Sections ---------- */
.section { padding: 90px 0; }
.section-head { text-align: center; max-width: 620px; margin: 0 auto 56px; }
.section-head .eyebrow { margin-bottom: 18px; }
.section-head h2 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}
.section-head p { color: var(--text-dim); font-size: 16.5px; }

/* ---------- Cards grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.card-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: var(--accent-dim);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent-strong);
  margin-bottom: 18px;
}
.card-icon svg { width: 20px; height: 20px; }

/* Generic icon sizing for any inline SVG inside icon slots */
.cr-icon svg, .side-icon svg { width: 18px; height: 18px; }
.card-icon svg, .cr-icon svg, .side-icon svg { display: block; }
.card h3 { font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.card p { color: var(--text-dim); font-size: 14.5px; }

/* ---------- Flow diagram ---------- */
.flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.flow-step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
}
.flow-arrow { color: var(--text-faint); font-size: 16px; }

/* ---------- Pricing ---------- */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.plan {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.plan.featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow);
}
.plan-name { font-weight: 700; font-size: 17px; }
.plan-price { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; }
.plan-price span { font-size: 14px; color: var(--text-faint); font-weight: 500; }
.plan ul { display: flex; flex-direction: column; gap: 10px; }
.plan li { color: var(--text-dim); font-size: 13.5px; display: flex; gap: 8px; }
.plan li::before { content: "✓"; color: var(--success); font-weight: 700; }
.badge {
  align-self: flex-start;
  background: var(--accent);
  color: #14100c;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 48px 0 32px;
  color: var(--text-faint);
  font-size: 13.5px;
}
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.footer-links { display: flex; gap: 22px; }
.footer-links a:hover { color: var(--text-dim); }

/* ===========================================================
   AUTH / ONBOARDING
=========================================================== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  box-shadow: var(--shadow);
}
.auth-card .logo { justify-content: center; margin-bottom: 28px; }
.auth-card h1 { font-size: 22px; font-weight: 700; text-align: center; margin-bottom: 8px; letter-spacing: -0.01em; }
.auth-card > p { color: var(--text-dim); font-size: 14.5px; text-align: center; margin-bottom: 30px; }

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.field input, .field textarea, .field select {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font-size: 14.5px;
  font-family: inherit;
  transition: border-color 0.15s ease;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--accent);
}
.field textarea { resize: vertical; min-height: 90px; }

.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-faint);
  font-size: 12.5px;
  margin: 22px 0;
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.oauth-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14.5px;
  font-weight: 500;
  margin-bottom: 10px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.oauth-btn:hover { border-color: var(--border-strong); background: var(--surface-2); }
.oauth-icon { width: 18px; height: 18px; flex-shrink: 0; }

.auth-switch { text-align: center; font-size: 13.5px; color: var(--text-faint); margin-top: 22px; }
.auth-switch a { color: var(--accent-strong); font-weight: 600; }

/* ---------- Onboarding shell ---------- */
.onboard-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.onboard-header {
  padding: 22px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.progress-track {
  flex: 1;
  max-width: 320px;
  height: 4px;
  background: var(--surface-2);
  border-radius: 999px;
  margin: 0 24px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.4s ease;
}
.step-label { color: var(--text-faint); font-size: 13px; font-weight: 600; white-space: nowrap; }
.save-status { color: var(--text-faint); font-size: 12.5px; white-space: nowrap; transition: opacity 0.2s ease; }
.save-status.saving { color: var(--accent-strong); }
.save-status.saved { color: var(--success); }

.onboard-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}
.onboard-step { width: 100%; max-width: 560px; display: none; }
.onboard-step.active { display: block; animation: fadeUp 0.35s ease; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.onboard-step h2 { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 10px; }
.onboard-step > p.step-desc { color: var(--text-dim); font-size: 15px; margin-bottom: 32px; }

.choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 28px; }
.choice-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.choice-card:hover { border-color: var(--border-strong); }
.choice-card.selected { border-color: var(--accent); background: var(--accent-dim); }
.choice-card .cc-title { font-weight: 600; font-size: 14.5px; margin-bottom: 4px; }
.choice-card .cc-sub { color: var(--text-faint); font-size: 12.5px; }

.connect-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 12px;
}
.connect-row .cr-left { display: flex; align-items: center; gap: 14px; }
.connect-row .cr-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; background: var(--surface-2);
}
.connect-row .cr-name { font-weight: 600; font-size: 14.5px; }
.connect-row .cr-sub { color: var(--text-faint); font-size: 12.5px; }
.connect-row.connected { border-color: var(--success); }
.tag {
  font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-faint); text-transform: uppercase;
}
.tag.soon { color: var(--warn); }
.tag.auto, #gmailTag { background: rgba(31, 157, 107, 0.1); color: var(--success); }

.onboard-nav { display: flex; justify-content: space-between; margin-top: 32px; }

/* ===========================================================
   DASHBOARD
=========================================================== */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar .logo { padding: 8px 10px 24px; }
.side-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--text-dim); font-size: 14px; font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}
.side-link:hover { background: var(--surface-2); color: var(--text); }
.side-link.active { background: var(--accent-dim); color: var(--accent-strong); font-weight: 600; }
.side-icon { width: 18px; text-align: center; }
.sidebar-footer { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(155deg, var(--accent), #c94f1e);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: #14100c; flex-shrink: 0;
}
.user-chip .uc-name { font-size: 13.5px; font-weight: 600; }
.user-chip .uc-plan { font-size: 11.5px; color: var(--text-faint); }

.main {
  flex: 1;
  padding: 32px 40px 60px;
  max-width: 1100px;
}
.main-head { margin-bottom: 32px; }
.main-head h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 6px; }
.main-head p { color: var(--text-dim); font-size: 14.5px; }

.big-prompt {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 32px;
}
.big-prompt label { display: block; font-size: 13px; color: var(--text-faint); font-weight: 600; margin-bottom: 12px; }
.big-prompt-row { display: flex; gap: 10px; }
.big-prompt input {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  color: var(--text);
  font-size: 14.5px;
}
.big-prompt input:focus { outline: none; border-color: var(--accent); }

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 32px; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}
.stat-card .st-label { color: var(--text-faint); font-size: 12.5px; font-weight: 600; margin-bottom: 8px; }
.stat-card .st-value { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.stat-card .st-delta { font-size: 12px; color: var(--success); margin-top: 4px; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.panel-head h3 { font-size: 15.5px; font-weight: 600; }
.panel-head a { font-size: 13px; color: var(--accent-strong); font-weight: 600; }

.task-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.task-item:last-child { border-bottom: none; }
.task-left { display: flex; align-items: center; gap: 12px; }
.task-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.task-title { font-size: 14px; font-weight: 500; }
.task-meta { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.task-actions { display: flex; gap: 8px; }
.status-pill {
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: 0.03em;
}
.status-pill.pending { background: var(--accent-dim); color: var(--accent-strong); }
.status-pill.scheduled { background: rgba(61,220,151,0.12); color: var(--success); }
.status-pill.draft { background: var(--surface-2); color: var(--text-faint); }

.mini-btn {
  padding: 7px 14px; border-radius: 8px; font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--border-strong); background: transparent; color: var(--text);
}
.mini-btn:hover { background: var(--surface-2); }
.mini-btn.primary { background: var(--accent); color: #14100c; border-color: var(--accent); }

/* ---------- Loading spinner (for buttons mid-request) ---------- */
.btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: btn-spin 0.6s linear infinite;
  vertical-align: -2px;
  margin-right: 8px;
}
.mini-btn .btn-spinner { margin-right: 6px; width: 12px; height: 12px; }
@keyframes btn-spin { to { transform: rotate(360deg); } }
button.is-loading { cursor: wait; opacity: 0.85; }

.empty-state {
  color: var(--text-faint);
  font-size: 13.5px;
  line-height: 1.6;
  padding: 8px 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid, .pricing-grid, .stat-row, .choice-grid { grid-template-columns: 1fr 1fr; }
  .sidebar { display: none; }
  .main { padding: 24px; }
}
@media (max-width: 620px) {
  .nav-links { display: none; }
  .grid, .pricing-grid, .stat-row, .choice-grid { grid-template-columns: 1fr; }
  .hero { padding: 70px 0 60px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
