:root {
  --primary: #0f2d5c;
  --primary-light: #1a4080;
  --primary-dark: #0a1f3d;
  --accent: #f97316;
  --accent-light: #fb923c;
  --accent-dark: #ea580c;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #eab308;
  --bg: #f8fafc;
  --bg-white: #ffffff;
  --text: #1e293b;
  --text-light: #64748b;
  --text-white: #ffffff;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --radius-card: 8px;
  --radius-btn: 6px;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-card-hover: 0 4px 6px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-cta: 0 4px 14px rgba(249,115,22,0.4);
  --max-width: 1200px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Barlow', sans-serif;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Barlow', sans-serif;
  font-weight: 700;
  line-height: 1.2;
  color: var(--primary);
}

h1 { font-size: 2.5rem; font-weight: 800; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent); }

img { max-width: 100%; height: auto; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-family: 'Barlow', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  line-height: 1.4;
}

.btn-primary {
  background: var(--primary);
  color: var(--text-white);
}
.btn-primary:hover { background: var(--primary-light); color: var(--text-white); }

.btn-accent {
  background: var(--accent);
  color: var(--text-white);
  box-shadow: var(--shadow-cta);
}
.btn-accent:hover { background: var(--accent-dark); color: var(--text-white); }

.btn-danger {
  background: var(--danger);
  color: var(--text-white);
  box-shadow: 0 4px 14px rgba(220,38,38,0.4);
}
.btn-danger:hover { background: #b91c1c; color: var(--text-white); }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: var(--text-white); }

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.125rem;
  font-weight: 700;
}

.btn-full { width: 100%; }

.btn-sm { padding: 0.5rem 1rem; font-size: 0.875rem; }

/* Cards */
.card {
  background: var(--bg-white);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 1.5rem;
  transition: box-shadow 0.2s;
}

.card:hover { box-shadow: var(--shadow-card-hover); }

.card-accent {
  background: var(--accent);
  color: var(--text-white);
  border-radius: var(--radius-card);
  padding: 2rem;
}
.card-accent h3, .card-accent h4 { color: var(--text-white); }

/* Grid */
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.375rem;
  color: var(--text);
  font-size: 0.9375rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: 'Barlow', sans-serif;
  font-size: 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-btn);
  background: var(--bg-white);
  color: var(--text);
  transition: border-color 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15,45,92,0.1);
}

.form-control.error {
  border-color: var(--danger);
}

.error-msg {
  color: var(--danger);
  font-size: 0.8125rem;
  margin-top: 0.25rem;
}

textarea.form-control { resize: vertical; min-height: 100px; }

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.checkbox-group input[type="checkbox"] {
  margin-top: 0.25rem;
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

/* Navigation */
.nav {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

.nav-logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
}
.nav-logo:hover { color: var(--primary); }
.nav-logo span { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.nav-links a:not(.btn) {
  color: var(--text);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.25rem 0;
}
.nav-links a:not(.btn):hover { color: var(--accent); }

.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  margin: 5px 0;
  transition: all 0.3s;
}

@media (max-width: 768px) {
  .nav-hamburger { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-white);
    flex-direction: column;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-card);
  }
  .nav-links.active { display: flex; }
  .nav-links .btn { width: 100%; }
}

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--text-white);
  padding: 3rem 0;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

.hero h1 { color: var(--text-white); margin-bottom: 1rem; }
.hero p { font-size: 1.125rem; opacity: 0.9; margin-bottom: 1.5rem; }

.trust-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  background: rgba(255,255,255,0.15);
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
}

@media (max-width: 768px) {
  .hero-inner { grid-template-columns: 1fr; gap: 2rem; }
  .hero { padding: 2rem 0; }
}

/* Social Proof Bar */
.social-proof {
  background: var(--accent);
  color: var(--text-white);
  padding: 1rem 0;
}

.social-proof-inner {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2rem;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
  font-weight: 600;
  font-size: 0.9375rem;
}

.social-proof-item { display: flex; align-items: center; gap: 0.5rem; }

/* Sections */
.section { padding: 4rem 0; }
.section-alt { background: var(--bg-white); }
.section-header { text-align: center; margin-bottom: 2.5rem; }
.section-header p { color: var(--text-light); font-size: 1.125rem; margin-top: 0.5rem; }

/* Issue Tiles */
.issue-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.issue-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.25rem;
  background: var(--bg-white);
  border: 2px solid var(--border);
  border-radius: var(--radius-card);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
}

.issue-tile:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-card-hover);
  color: var(--text);
}

.issue-tile .icon { font-size: 2rem; }

@media (max-width: 768px) {
  .issue-tiles { grid-template-columns: repeat(2, 1fr); }
}

/* Steps */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  text-align: center;
}

.step-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--text-white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

@media (max-width: 768px) {
  .steps { grid-template-columns: 1fr; }
}

/* Lead Form Multi-Step */
.lead-form-card {
  background: var(--bg-white);
  border-radius: var(--radius-card);
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  padding: 2rem;
  max-width: 480px;
}

.lead-form-card h3 { margin-bottom: 1.5rem; text-align: center; }

.progress-bar {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
}

.progress-step {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  transition: background 0.3s;
}

.progress-step.active { background: var(--accent); }

.form-step { display: none; }
.form-step.active { display: block; }

.urgency-tile, .issue-form-tile {
  display: block;
  width: 100%;
  padding: 0.875rem 1rem;
  margin-bottom: 0.5rem;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-btn);
  cursor: pointer;
  font-family: 'Barlow', sans-serif;
  font-size: 0.9375rem;
  font-weight: 600;
  text-align: left;
  transition: all 0.2s;
  color: var(--text);
}

.urgency-tile:hover, .issue-form-tile:hover {
  border-color: var(--primary);
  background: rgba(15,45,92,0.05);
}

.urgency-tile.selected, .issue-form-tile.selected {
  border-color: var(--accent);
  background: rgba(249,115,22,0.08);
}

.emergency-msg {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--danger);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-btn);
  margin: 0.75rem 0;
  font-size: 0.875rem;
  font-weight: 600;
}

/* Footer */
.footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.8);
  padding: 3rem 0 1.5rem;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.footer-links a { color: rgba(255,255,255,0.8); font-weight: 600; font-size: 0.9375rem; }
.footer-links a:hover { color: var(--accent); }

.footer-trust {
  text-align: center;
  font-size: 0.8125rem;
  opacity: 0.7;
  max-width: 600px;
  margin: 0 auto 1.5rem;
}

.footer-copyright {
  text-align: center;
  font-size: 0.8125rem;
  opacity: 0.5;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.footer-cta {
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  margin-bottom: 2rem;
  text-align: center;
}

.footer-cta h4 { color: var(--text-white); margin-bottom: 1rem; }
.footer-cta form { display: flex; gap: 0.5rem; max-width: 500px; margin: 0 auto; }
.footer-cta .form-control { flex: 1; }

@media (max-width: 768px) {
  .footer-cta form { flex-direction: column; }
}

/* Sticky Mobile CTA */
.sticky-cta {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--accent);
  padding: 0.5rem;
}

.sticky-cta-inner {
  display: flex;
  gap: 0.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.sticky-cta .btn {
  flex: 1;
  font-size: 0.875rem;
  padding: 0.625rem;
}

@media (max-width: 768px) {
  .sticky-cta { display: block; }
  body { padding-bottom: 70px; }
}

/* Emergency Page */
.emergency-banner {
  background: var(--danger);
  color: var(--text-white);
  text-align: center;
  padding: 1rem;
  font-weight: 700;
  font-size: 1.125rem;
}

.emergency-section {
  background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
  color: var(--text-white);
  padding: 3rem 0;
}

.emergency-section h1, .emergency-section h2, .emergency-section h3 { color: var(--text-white); }

.stat-card {
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  text-align: center;
}

.stat-card .stat-number {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-emergency { background: #fef2f2; color: var(--danger); }
.badge-urgent { background: #fffbeb; color: #b45309; }
.badge-standard { background: #f0fdf4; color: var(--success); }
.badge-high-value { background: #fef3c7; color: #92400e; }
.badge-easy { background: #f0fdf4; color: var(--success); }
.badge-medium { background: #fffbeb; color: #b45309; }
.badge-hard { background: #fef2f2; color: var(--danger); }
.badge-category {
  background: rgba(15,45,92,0.1);
  color: var(--primary);
}
.badge-ai {
  background: #ede9fe;
  color: #6d28d9;
  margin-left: 0.25rem;
}

.context-banner {
  background: #ede9fe;
  color: #4c1d95;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  border-left: 3px solid #7c3aed;
}

/* Cost Range Bar */
.cost-range {
  position: relative;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  margin: 2rem 0 1rem;
}

.cost-range-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--success), var(--accent), var(--danger));
  border-radius: 4px;
  width: 100%;
}

.cost-range-marker {
  position: absolute;
  top: -6px;
  width: 20px;
  height: 20px;
  background: var(--primary);
  border-radius: 50%;
  border: 3px solid var(--bg-white);
  box-shadow: var(--shadow-card);
  transform: translateX(-50%);
}

.cost-labels {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  margin-top: 0.5rem;
}

.cost-avg { text-align: center; font-weight: 700; font-size: 1.25rem; color: var(--primary); margin-top: 0.5rem; }

/* FAQ Accordions */
details {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  margin-bottom: 0.5rem;
  background: var(--bg-white);
}

details summary {
  padding: 1rem 1.25rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

details summary::-webkit-details-marker { display: none; }

details summary::after {
  content: '+';
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-light);
  transition: transform 0.2s;
}

details[open] summary::after {
  content: '−';
  color: var(--accent);
}

details .faq-answer {
  padding: 0 1.25rem 1.25rem;
  color: var(--text-light);
  line-height: 1.7;
}

/* Admin */
.admin-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.admin-tab {
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--text-light);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  font-family: 'Barlow', sans-serif;
  font-size: 0.9375rem;
  transition: all 0.2s;
}

.admin-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.admin-tab:hover { color: var(--primary); }

.admin-panel {
  display: none;
}
.admin-panel.active { display: block; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

th, td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--bg);
  font-weight: 700;
  position: sticky;
  top: 0;
}

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
}

/* Resource Cards */
.resource-card {
  display: block;
  background: var(--bg-white);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 1.25rem;
  transition: all 0.2s;
  text-decoration: none;
  color: var(--text);
}

.resource-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
  color: var(--text);
}

.resource-card h4 { margin-bottom: 0.5rem; }

.resource-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

/* Search */
.search-bar {
  position: relative;
  max-width: 400px;
  margin-bottom: 1.5rem;
}

.search-bar input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-btn);
  font-size: 1rem;
  font-family: 'Barlow', sans-serif;
}

.search-bar::before {
  content: '🔍';
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
}

/* Category Tabs */
.category-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.category-tab {
  padding: 0.5rem 1rem;
  border: 2px solid var(--border);
  border-radius: 20px;
  background: var(--bg-white);
  cursor: pointer;
  font-family: 'Barlow', sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-light);
  transition: all 0.2s;
}

.category-tab.active, .category-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(15,45,92,0.05);
}

/* Loading Spinner */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: var(--text-white);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

.btn.loading {
  pointer-events: none;
  opacity: 0.8;
}

/* Utility */
.text-center { text-align: center; }
.text-light { color: var(--text-light); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.hidden { display: none !important; }

/* Service page */
.service-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--text-white);
  padding: 3rem 0;
}

.service-hero h1 { color: var(--text-white); }
.service-hero p { color: rgba(255,255,255,0.9); font-size: 1.125rem; }

/* CTA Card */
.cta-card {
  background: var(--accent);
  color: var(--text-white);
  border-radius: var(--radius-card);
  padding: 2rem;
  text-align: center;
  margin: 2rem 0;
}

.cta-card h3 { color: var(--text-white); margin-bottom: 0.75rem; }
.cta-card p { margin-bottom: 1.25rem; opacity: 0.95; }
.cta-card .btn { background: var(--primary); }
.cta-card .btn:hover { background: var(--primary-light); }

/* AI Results */
.ai-result {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  line-height: 1.8;
}

.ai-result strong { color: var(--primary); }
.ai-result ul { padding-left: 1.5rem; margin: 0.5rem 0; }

/* Plumber Signup */
.pricing-card {
  border: 2px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  text-align: center;
}

.pricing-card .price {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
}

/* Login */
.login-page {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: var(--bg-white);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 2rem;
  width: 100%;
  max-width: 400px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
