/* BuildPath Design System */
/* Vibe: Dark industrial/professional — contractors work in the field, not offices */
/* Fonts: DM Mono (headings) + Outfit (body) */

@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Outfit:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --bg: #0e1117;
  --bg-2: #161b27;
  --bg-3: #1e2535;
  --border: #2a3347;
  --border-light: #36445e;
  --text: #e8edf5;
  --text-muted: #8494ad;
  --text-dim: #4f607a;
  --accent: #f59e0b;      /* amber — construction yellow */
  --accent-2: #10b981;    /* green — for savings/success */
  --accent-3: #3b82f6;    /* blue — for info */
  --danger: #ef4444;
  --radius: 6px;
  --radius-lg: 12px;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Typography ── */
h1, h2, h3, h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
h1 { font-size: clamp(2.2rem, 5vw, 4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.5rem); }
h3 { font-size: 1.25rem; }

.mono { font-family: 'DM Mono', monospace; }

/* ── Layout ── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
.container-sm { max-width: 720px; margin: 0 auto; padding: 0 1.5rem; }

/* ── Nav ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(14, 17, 23, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.nav-logo .logo-icon {
  width: 32px; height: 32px;
  background: var(--accent);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}
.nav-links { display: flex; align-items: center; gap: 1.5rem; }
.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius);
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.2s ease;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: #0e1117;
}
.btn-primary:hover { background: #f7b731; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(245,158,11,0.3); }
.btn-secondary {
  background: var(--bg-3);
  color: var(--text);
  border: 1px solid var(--border-light);
}
.btn-secondary:hover { background: var(--border); }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: var(--border-light); }
.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.8rem; }
.btn-lg { padding: 0.85rem 2rem; font-size: 1rem; }
.btn-block { width: 100%; }

/* ── Cards ── */
.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.card-sm { padding: 1rem; }

/* ── Forms ── */
.form-group { margin-bottom: 1.25rem; }
.label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}
.input, .select, .textarea {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  padding: 0.65rem 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245,158,11,0.12);
}
.input::placeholder { color: var(--text-dim); }
.textarea { resize: vertical; min-height: 100px; }
.select { appearance: none; cursor: pointer; }

/* ── Alerts ── */
.alert {
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}
.alert-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  color: #fca5a5;
}
.alert-success {
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.3);
  color: #6ee7b7;
}

/* ── Landing Hero ── */
.hero {
  padding: 7rem 0 5rem;
  background: radial-gradient(ellipse 60% 40% at 50% -10%, rgba(245,158,11,0.08) 0%, transparent 70%);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%232a3347' fill-opacity='0.4'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.3;
}
.hero-content { position: relative; z-index: 1; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: 100px;
  padding: 0.35rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 1.5rem;
  letter-spacing: 0.03em;
}
.hero h1 { margin-bottom: 1.25rem; max-width: 700px; }
.hero h1 span { color: var(--accent); }
.hero p {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 560px;
  margin-bottom: 2.5rem;
  line-height: 1.7;
}
.hero-cta { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.hero-proof {
  margin-top: 3rem;
  display: flex;
  gap: 2.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.proof-item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.proof-number {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.proof-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Feature Sections ── */
.section { padding: 5rem 0; }
.section-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 3rem;
}
.feature-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: border-color 0.2s, transform 0.2s;
}
.feature-card:hover { border-color: var(--border-light); transform: translateY(-2px); }
.feature-icon {
  width: 44px; height: 44px;
  background: rgba(245,158,11,0.1);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(245,158,11,0.2);
}
.feature-card h3 { margin-bottom: 0.5rem; font-size: 1.05rem; }
.feature-card p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; }

/* ── Pricing ── */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}
.pricing-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  position: relative;
  transition: border-color 0.2s;
}
.pricing-card.featured {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--bg-2) 0%, rgba(245,158,11,0.04) 100%);
}
.pricing-badge {
  position: absolute;
  top: -1px;
  right: 1.5rem;
  background: var(--accent);
  color: #0e1117;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
  border-radius: 0 0 var(--radius) var(--radius);
}
.pricing-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}
.pricing-price {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 3rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 0.25rem;
}
.pricing-price span { font-size: 1rem; font-weight: 400; color: var(--text-muted); }
.pricing-desc {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}
.pricing-features { list-style: none; margin-bottom: 2rem; }
.pricing-features li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
}
.pricing-features li:last-child { border-bottom: none; }
.pricing-features li .check { color: var(--accent-2); flex-shrink: 0; margin-top: 2px; }

/* ── App Shell ── */
.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo .logo-icon {
  width: 28px; height: 28px;
  background: var(--accent);
  border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
  color: #0e1117;
  font-weight: 900;
}
.sidebar-nav { flex: 1; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.15s;
  margin-bottom: 0.15rem;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
  background: var(--bg-3);
  color: var(--text);
}
.sidebar-nav a.active { color: var(--accent); }
.sidebar-bottom {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.sidebar-user {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.sidebar-user .avatar {
  width: 28px; height: 28px;
  background: var(--bg-3);
  border-radius: 50%;
  border: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  color: var(--text);
  font-weight: 600;
}

/* ── App Main ── */
.app-main { min-height: 100vh; background: var(--bg); }
.app-header {
  padding: 1.25rem 2rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.app-header h1 { font-size: 1.35rem; }
.app-body { padding: 2rem; }

/* ── Pricing Table ── */
.pricing-table-wrap {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.pricing-table-toolbar {
  padding: 1rem 1.25rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.cat-filter {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.cat-btn {
  padding: 0.3rem 0.75rem;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  transition: all 0.15s;
}
.cat-btn:hover, .cat-btn.active {
  background: var(--bg-3);
  border-color: var(--border-light);
  color: var(--text);
}
.cat-btn.active { border-color: var(--accent); color: var(--accent); }

.pricing-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.pricing-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  background: var(--bg-3);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.pricing-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.pricing-table tr:last-child td { border-bottom: none; }
.pricing-table tr:hover td { background: rgba(255,255,255,0.02); }
.pricing-table tr.selected td { background: rgba(245,158,11,0.04); }

.item-name { font-weight: 500; color: var(--text); }
.item-cat {
  font-size: 0.73rem;
  color: var(--text-dim);
  margin-top: 1px;
}
.price-cell { font-family: 'DM Mono', monospace; font-size: 0.85rem; }
.price-range { color: var(--text-muted); }
.price-override {
  color: var(--accent);
  font-weight: 500;
}
.override-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  background: rgba(245,158,11,0.12);
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: 100px;
  padding: 0.1rem 0.5rem;
  color: var(--accent);
  white-space: nowrap;
}
.qty-input {
  width: 70px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'DM Mono', monospace;
  font-size: 0.82rem;
  padding: 0.3rem 0.5rem;
  text-align: center;
}
.qty-input:focus { outline: none; border-color: var(--accent); }

/* Select checkbox col */
.select-col { width: 40px; text-align: center; }
input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px; height: 16px;
  cursor: pointer;
}

/* ── Estimate Panel ── */
.estimate-panel {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.estimate-panel-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.estimate-panel-header h3 { font-size: 1rem; }
.estimate-body { padding: 1.25rem 1.5rem; }
.estimate-total {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  margin-top: 1rem;
}
.estimate-total-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.estimate-total-amount {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
}
.estimate-line-items { font-size: 0.82rem; }
.estimate-line {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  gap: 0.5rem;
}
.estimate-line:last-child { border-bottom: none; }
.estimate-line-name { color: var(--text-muted); flex: 1; }
.estimate-line-amount { font-family: 'DM Mono', monospace; color: var(--text); white-space: nowrap; }

/* ── Override Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal {
  background: var(--bg-2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 440px;
  padding: 2rem;
}
.modal h3 { margin-bottom: 0.25rem; }
.modal-subtitle { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 1.5rem; }
.modal-footer {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

/* ── Auth Pages ── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse 50% 50% at 50% -20%, rgba(245,158,11,0.06) 0%, transparent 60%);
  padding: 2rem;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
}
.auth-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
}
.auth-logo .logo-icon {
  width: 32px; height: 32px;
  background: var(--accent);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; color: #0e1117; font-weight: 900;
}
.auth-title { margin-bottom: 0.4rem; font-size: 1.5rem; }
.auth-subtitle { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 2rem; }
.auth-footer {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.auth-footer a { color: var(--accent); text-decoration: none; }
.auth-footer a:hover { text-decoration: underline; }

/* ── Success Page ── */
.success-page { text-align: center; padding: 4rem 2rem; }
.success-icon {
  width: 80px; height: 80px;
  background: rgba(16,185,129,0.1);
  border: 2px solid rgba(16,185,129,0.3);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem;
  margin: 0 auto 1.5rem;
}

/* ── Footer (landing) ── */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ── Divider ── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

/* ── Utilities ── */
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-success { color: var(--accent-2); }
.text-sm { font-size: 0.85rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.gap-1 { gap: 0.5rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.hidden { display: none !important; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .hero { padding: 4rem 0 3rem; }
  .hero-proof { gap: 1.5rem; }
  .pricing-grid { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .app-body { padding: 1rem; }
  .app-header { padding: 1rem; }
}

/* ── Scroll animations ── */
.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Number input arrows hidden ── */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }
