/* ===========================
   InboxPilot — style.css
   Design brief: product/design-brief.md
   =========================== */

/* --- RESET & BASE --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #F8F9FB;
  color: #1A202C;
  line-height: 1.6;
}
a { color: #2E9CCA; text-decoration: none; }
a:hover { text-decoration: underline; }
ul { list-style: none; }

/* --- TOKENS --- */
:root {
  --primary: #1C3D5A;
  --accent: #2E9CCA;
  --bg: #F8F9FB;
  --surface: #FFFFFF;
  --text: #1A202C;
  --muted: #718096;
  --success: #38A169;
  --warning: #DD6B20;
  --border: #E2E8F0;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
}

/* --- CONTAINER --- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* --- BUTTONS --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: inherit; font-size: 0.9375rem; font-weight: 600;
  border-radius: var(--radius); padding: 10px 20px;
  cursor: pointer; border: 2px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap; min-height: 44px;
}
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: #1f7eaa; border-color: #1f7eaa; text-decoration: none; }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; text-decoration: none; }
.btn-ghost { background: transparent; color: var(--primary); border-color: transparent; }
.btn-ghost:hover { background: var(--border); text-decoration: none; }
.btn-lg { font-size: 1.0625rem; padding: 14px 28px; }
.btn-sm { font-size: 0.875rem; padding: 7px 14px; min-height: 36px; }
.btn-full { width: 100%; }

/* --- NAV --- */
.nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}
.nav-logo {
  font-size: 1.25rem; font-weight: 700; color: var(--primary);
  letter-spacing: -0.01em; text-decoration: none;
}
.nav-actions { display: flex; gap: 8px; align-items: center; }
.nav-user-email { font-size: 0.875rem; color: var(--muted); margin-right: 4px; }

/* --- HERO --- */
.hero {
  padding: 80px 0 72px;
  text-align: center;
}
.hero-inner { max-width: 680px; margin: 0 auto; }
.hero-label {
  display: inline-block;
  background: #EBF5FB; color: var(--accent);
  font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.04em;
  padding: 4px 12px; border-radius: 100px;
  text-transform: uppercase; margin-bottom: 20px;
}
.hero-headline {
  font-size: clamp(2rem, 5vw, 3rem); font-weight: 700;
  color: var(--primary); line-height: 1.15; margin-bottom: 20px;
  letter-spacing: -0.02em;
}
.hero-sub {
  font-size: 1.125rem; color: var(--muted);
  max-width: 520px; margin: 0 auto 32px;
}
.hero-cta-group { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.hero-cta-note { font-size: 0.875rem; color: var(--muted); }

/* --- SECTION HEADINGS --- */
.section-heading {
  font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700;
  color: var(--primary); text-align: center;
  margin-bottom: 12px; letter-spacing: -0.015em;
}
.section-sub { text-align: center; color: var(--muted); margin-bottom: 40px; }
.section-heading-sm {
  font-size: 1.125rem; font-weight: 600; color: var(--primary);
  margin-bottom: 12px;
}
.section-desc { color: var(--muted); font-size: 0.9375rem; margin-bottom: 16px; }

/* --- PROBLEMS --- */
.problems { padding: 64px 0; background: var(--surface); }
.problems .section-heading { margin-bottom: 40px; }
.problem-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}
.problem-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px 24px;
  box-shadow: var(--shadow);
}
.problem-icon { font-size: 1.75rem; margin-bottom: 12px; }
.problem-card h3 { font-size: 1rem; font-weight: 600; color: var(--primary); margin-bottom: 8px; }
.problem-card p { font-size: 0.9375rem; color: var(--muted); }

/* --- HOW IT WORKS --- */
.how-it-works { padding: 72px 0; }
.steps-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 32px; margin-top: 40px;
}
.step { text-align: center; }
.step-number {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-size: 1.125rem; font-weight: 700; margin: 0 auto 16px;
}
.step h3 { font-size: 1rem; font-weight: 600; color: var(--primary); margin-bottom: 8px; }
.step p { font-size: 0.9375rem; color: var(--muted); }

/* --- PRICING --- */
.pricing { padding: 72px 0; background: var(--surface); }
.pricing-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px; margin-top: 40px; align-items: start;
}
.pricing-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px 28px;
  box-shadow: var(--shadow); position: relative;
}
.pricing-card--featured {
  background: var(--primary); border-color: var(--primary);
  box-shadow: var(--shadow-md);
}
.pricing-card--featured .plan-name,
.pricing-card--featured .plan-price,
.pricing-card--featured .plan-features li { color: #fff; }
.pricing-card--featured .plan-period,
.pricing-card--featured .plan-annual-note { color: rgba(255,255,255,0.7); }
.plan-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #fff;
  font-size: 0.75rem; font-weight: 700; padding: 3px 12px; border-radius: 100px;
  white-space: nowrap;
}
.plan-name { font-size: 1rem; font-weight: 700; color: var(--primary); margin-bottom: 8px; }
.plan-price {
  font-size: 2.5rem; font-weight: 700; color: var(--primary);
  line-height: 1; margin-bottom: 4px;
}
.plan-period { font-size: 1rem; font-weight: 400; color: var(--muted); }
.plan-annual-note { font-size: 0.8125rem; color: var(--muted); margin-bottom: 20px; }
.plan-features { margin-bottom: 24px; }
.plan-features li {
  font-size: 0.9375rem; color: var(--text);
  padding: 6px 0; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.pricing-card--featured .plan-features li { border-bottom-color: rgba(255,255,255,0.15); }
.plan-features li::before { content: "✓"; color: var(--success); font-weight: 700; }
.pricing-card--featured .plan-features li::before { color: var(--accent); }

/* --- FOOTER --- */
.footer { background: var(--primary); color: #fff; padding: 32px 0; }
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
}
.footer-logo { font-size: 1rem; font-weight: 700; }
.footer-tagline { font-size: 0.875rem; color: rgba(255,255,255,0.65); }
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: rgba(255,255,255,0.8); font-size: 0.875rem; }
.footer-links a:hover { color: #fff; }

/* --- AUTH PAGE --- */
.auth-page { display: flex; flex-direction: column; min-height: 100vh; }
.auth-main {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 40px 24px;
}
.auth-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 40px 36px;
  width: 100%; max-width: 440px;
  box-shadow: var(--shadow-md);
}
.auth-heading {
  font-size: 1.5rem; font-weight: 700; color: var(--primary);
  margin-bottom: 10px;
}
.auth-sub { font-size: 0.9375rem; color: var(--muted); margin-bottom: 28px; }
.auth-sent-icon { font-size: 2.5rem; margin-bottom: 16px; }
.auth-sent-heading { font-size: 1.25rem; font-weight: 700; color: var(--primary); margin-bottom: 8px; }
.auth-sent-body { font-size: 0.9375rem; color: var(--muted); margin-bottom: 20px; }

/* --- FORMS --- */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 0.875rem; font-weight: 500; color: var(--text); margin-bottom: 6px; }
.form-input {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-family: inherit; font-size: 1rem; color: var(--text);
  background: var(--bg);
  transition: border-color 0.15s;
  min-height: 44px;
}
.form-input:focus { outline: none; border-color: var(--accent); }
.form-select {
  padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius);
  font-family: inherit; font-size: 0.9375rem; color: var(--text);
  background: var(--bg); min-height: 44px; cursor: pointer;
}
.form-textarea {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-family: inherit; font-size: 0.9375rem; color: var(--text);
  background: var(--bg); resize: vertical;
}
.form-error { color: #E53E3E; font-size: 0.875rem; margin-top: 8px; }

/* --- DEBUG NOTICES --- */
.debug-notice {
  margin-top: 20px; padding: 10px 14px;
  background: #FFF3CD; border: 1px solid #F6AD55;
  border-radius: var(--radius); font-size: 0.8125rem; color: #7B341E;
}
.debug-banner {
  background: #FFF3CD; border-bottom: 2px solid #F6AD55;
  padding: 10px 24px; font-size: 0.8125rem; color: #7B341E;
  text-align: center;
}
.debug-banner code {
  background: rgba(0,0,0,0.08); border-radius: 4px; padding: 1px 5px;
  font-family: 'JetBrains Mono', monospace;
}

/* --- DASHBOARD LAYOUT --- */
.dashboard-page { min-height: 100vh; }
.dashboard-layout { display: flex; min-height: calc(100vh - 61px); }
.sidebar {
  width: 240px; background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  flex-shrink: 0;
}
.sidebar-label {
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted);
  margin-bottom: 10px;
}
.sidebar-section { margin-bottom: 24px; }
.client-list { }
.client-item {
  padding: 8px 10px; border-radius: var(--radius);
  cursor: pointer; font-size: 0.9375rem; color: var(--text);
  transition: background 0.12s;
}
.client-item:hover { background: var(--bg); }
.client-item--loading { color: var(--muted); font-size: 0.875rem; }
.client-item--active { background: #EBF5FB; color: var(--accent); font-weight: 600; }
.sidebar-upgrade-cta {
  background: #FFF8F0; border: 1px solid #F6AD55;
  border-radius: var(--radius); padding: 14px 12px;
  font-size: 0.875rem; color: var(--text);
}
.sidebar-upgrade-cta p { margin-bottom: 10px; }
.dashboard-main { flex: 1; padding: 32px; overflow-y: auto; }

/* --- AUTH GATE --- */
.auth-gate {
  display: flex; align-items: center; justify-content: center;
  min-height: 400px;
}
.auth-gate-inner { text-align: center; max-width: 360px; }
.auth-gate-inner h2 { margin-bottom: 10px; color: var(--primary); }
.auth-gate-inner p { color: var(--muted); margin-bottom: 20px; }

/* --- DASHBOARD GREETING --- */
.dashboard-greeting {
  font-size: 1.125rem; font-weight: 500; color: var(--primary);
  margin-bottom: 28px;
}

/* --- DELIVERIES --- */
.deliveries-section,
.add-section,
.paste-section { margin-bottom: 36px; }
.deliveries-list { }
.delivery-item {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  margin-bottom: 8px;
}
.delivery-item.done { opacity: 0.5; }
.delivery-checkbox {
  width: 20px; height: 20px; border: 2px solid var(--border);
  border-radius: 4px; cursor: pointer; flex-shrink: 0;
  margin-top: 2px; display: flex; align-items: center; justify-content: center;
  transition: background 0.12s, border-color 0.12s;
}
.delivery-checkbox.checked {
  background: var(--success); border-color: var(--success); color: #fff;
}
.delivery-body { flex: 1; }
.delivery-client { font-size: 0.75rem; font-weight: 600; color: var(--accent); text-transform: uppercase; margin-bottom: 3px; }
.delivery-text { font-size: 0.9375rem; color: var(--text); }
.delivery-due { font-size: 0.8125rem; color: var(--muted); margin-top: 3px; }
.delivery-due.overdue { color: var(--warning); font-weight: 600; }
.empty-state { color: var(--muted); font-size: 0.9375rem; padding: 24px 0; }

/* --- ADD / PASTE FORMS --- */
.form-row {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-start;
}
.form-row .form-input { flex: 2; min-width: 160px; }
.form-row .form-input--date { flex: 1; min-width: 140px; }
.form-row .form-select { flex: 1; min-width: 160px; }
.paste-form { display: flex; flex-direction: column; gap: 10px; }
.extract-result {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; font-size: 0.9375rem;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
  .hero { padding: 48px 0 40px; }
  .dashboard-layout { flex-direction: column; }
  .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
  .footer-inner { flex-direction: column; text-align: center; }
  .nav-actions .btn-ghost { display: none; }
}
