/* Funeral Cost Calculator - Shared Stylesheet */

/* CSS Variables */
:root {
  --color-navy: #1a2744;
  --color-navy-light: #2d3f5e;
  --color-white: #ffffff;
  --color-off-white: #f8f9fa;
  --color-gray-100: #f1f3f5;
  --color-gray-200: #e9ecef;
  --color-gray-300: #dee2e6;
  --color-gray-500: #6b7280;
  --color-gray-700: #374151;
  --color-gray-900: #111827;
  --color-accent: #2563eb;
  --color-accent-hover: #1d4ed8;
  --color-success: #059669;
  --color-warning: #d97706;
  --color-danger: #dc2626;
  --color-text: #1f2937;
  --color-text-secondary: #4b5563;
  --color-text-muted: #6b7280;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--color-text);
  background: var(--color-white);
  line-height: 1.6;
  min-height: 100vh;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-accent); text-decoration: none; }
a:hover { color: var(--color-accent-hover); text-decoration: underline; }

/* Typography */
h1, h2, h3, h4 {
  color: var(--color-navy);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.5em;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }
p { margin-bottom: 1em; }
.cost-number {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 1.1em;
  color: var(--color-navy);
}

/* Layout */
.container { max-width: 720px; margin: 0 auto; padding: 0 20px; }
.container-wide { max-width: 960px; margin: 0 auto; padding: 0 20px; }

/* Nav */
.site-nav {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-gray-200);
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-nav .nav-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.site-nav .nav-logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-navy);
  text-decoration: none;
}
.site-nav .nav-logo:hover { text-decoration: none; }
.site-nav .nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
}
.site-nav .nav-links a {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s;
}
.site-nav .nav-links a:hover { color: var(--color-accent); text-decoration: none; }
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--color-navy);
}
.nav-hamburger svg { display: block; }

/* Footer */
.site-footer {
  background: var(--color-navy);
  color: var(--color-white);
  padding: 40px 20px;
  margin-top: 60px;
}
.site-footer .footer-inner {
  max-width: 960px;
  margin: 0 auto;
}
.site-footer .footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  list-style: none;
  margin-bottom: 20px;
}
.site-footer .footer-links a {
  color: rgba(255,255,255,0.8);
  font-size: 0.9rem;
  text-decoration: none;
}
.site-footer .footer-links a:hover { color: var(--color-white); text-decoration: underline; }
.site-footer .footer-disclaimer {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.6);
  margin-top: 16px;
  line-height: 1.5;
}
.site-footer .footer-copyright {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
}

/* Cards */
.card {
  background: var(--color-white);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  border-radius: 8px;
  padding: 24px;
}

/* Hero */
.hero {
  text-align: center;
  padding: 48px 20px;
  background: var(--color-off-white);
}
.hero h1 { margin-bottom: 12px; }
.hero p { color: var(--color-text-secondary); font-size: 1.1rem; max-width: 600px; margin: 0 auto 12px; }
.hero .stat {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

/* Calculator Section */
.calculator-section {
  padding: 40px 20px;
  max-width: 720px;
  margin: 0 auto;
}

/* Step Indicator / Progress */
.calc-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 32px;
}
.calc-progress .step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--color-gray-200);
  color: var(--color-text-muted);
  transition: all 0.3s;
}
.calc-progress .step-dot.active {
  background: var(--color-accent);
  color: var(--color-white);
}
.calc-progress .step-dot.completed {
  background: var(--color-success);
  color: var(--color-white);
}
.calc-progress .step-line {
  width: 24px;
  height: 2px;
  background: var(--color-gray-200);
  transition: background 0.3s;
}
.calc-progress .step-line.completed { background: var(--color-success); }

/* Calculator Steps */
.calc-step { display: none; animation: fadeIn 0.3s ease; }
.calc-step.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.calc-step h3 { text-align: center; margin-bottom: 24px; font-size: 1.3rem; }

/* Option Cards (radio-style) */
.option-cards {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
}
.option-card {
  border: 2px solid var(--color-gray-200);
  border-radius: 8px;
  padding: 16px 20px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--color-white);
}
.option-card:hover { border-color: var(--color-accent); background: var(--color-off-white); }
.option-card.selected { border-color: var(--color-accent); background: #eff6ff; }
.option-card .option-radio {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--color-gray-300);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.option-card.selected .option-radio {
  border-color: var(--color-accent);
  background: var(--color-accent);
}
.option-card.selected .option-radio::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-white);
}
.option-card .option-label { font-weight: 500; }
.option-card .option-hint { font-size: 0.85rem; color: var(--color-text-muted); }

/* Form Elements */
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
  font-size: 0.95rem;
}
.form-input, .form-select {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--color-gray-300);
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--color-text);
  background: var(--color-white);
  transition: border-color 0.2s;
}
.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--color-navy);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

/* Age Input with +/- */
.age-input-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 24px 0;
}
.age-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--color-gray-300);
  background: var(--color-white);
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-navy);
  transition: all 0.2s;
}
.age-btn:hover { border-color: var(--color-accent); background: var(--color-off-white); }
.age-display {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-navy);
  width: 100px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
  text-decoration: none;
}
.btn-primary {
  background: var(--color-accent);
  color: var(--color-white);
  border-color: var(--color-accent);
}
.btn-primary:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  color: var(--color-white);
  text-decoration: none;
}
.btn-secondary {
  background: var(--color-white);
  color: var(--color-navy);
  border-color: var(--color-navy);
}
.btn-secondary:hover { background: var(--color-off-white); text-decoration: none; }
.btn-lg { min-height: 56px; padding: 0 32px; font-size: 1.1rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Calculator Navigation */
.calc-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
  gap: 12px;
}
.calc-nav .btn-back {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 0.95rem;
  font-family: inherit;
  padding: 8px 0;
}
.calc-nav .btn-back:hover { color: var(--color-text); }

/* Results Section */
.results-section {
  padding: 40px 20px;
  max-width: 960px;
  margin: 0 auto;
}
.results-card {
  background: var(--color-white);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  overflow: hidden;
  margin-bottom: 24px;
}

/* Cost Breakdown Table */
.cost-breakdown { width: 100%; border-collapse: collapse; }
.cost-breakdown th {
  background: var(--color-navy);
  color: var(--color-white);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.9rem;
}
.cost-breakdown th:last-child, .cost-breakdown th:nth-child(2) { text-align: right; }
.cost-breakdown td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-gray-100);
  font-size: 0.95rem;
}
.cost-breakdown td:last-child, .cost-breakdown td:nth-child(2) {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.cost-breakdown tr:nth-child(even) { background: var(--color-gray-100); }
.cost-breakdown .total-row {
  background: var(--color-off-white);
  font-weight: 700;
  font-size: 1.05rem;
}
.cost-breakdown .total-row td { border-top: 2px solid var(--color-navy); padding: 16px; }

/* Total Range Display */
.total-range {
  text-align: center;
  padding: 24px;
  background: var(--color-off-white);
}
.total-range .range-label { font-size: 0.9rem; color: var(--color-text-muted); margin-bottom: 4px; }
.total-range .range-amount {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-navy);
  font-variant-numeric: tabular-nums;
}

/* Comparison Bar */
.comparison-card {
  background: var(--color-white);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  padding: 24px;
  margin-bottom: 24px;
}
.comparison-bars { margin: 20px 0; }
.comparison-bar-item { margin-bottom: 16px; }
.comparison-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-bottom: 6px;
}
.comparison-bar-label .bar-name { font-weight: 500; }
.comparison-bar-label .bar-amount { font-weight: 600; font-variant-numeric: tabular-nums; }
.comparison-bar-track {
  height: 28px;
  background: var(--color-gray-100);
  border-radius: 4px;
  overflow: hidden;
}
.comparison-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s ease;
}
.comparison-bar-fill.your-estimate { background: var(--color-accent); }
.comparison-bar-fill.national-avg { background: var(--color-gray-500); }
.state-context {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  margin-top: 12px;
  padding: 12px 16px;
  background: var(--color-off-white);
  border-radius: 6px;
}

/* Tips Card */
.tips-card {
  background: var(--color-white);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  padding: 24px;
  margin-bottom: 24px;
}
.tips-card h3 { color: var(--color-success); }
.tip-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-gray-100);
  font-size: 0.95rem;
  line-height: 1.5;
}
.tip-item:last-child { border-bottom: none; }
.tip-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  background: var(--color-success);
  color: var(--color-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: 2px;
}

/* Lead CTA Card */
.lead-cta-card {
  background: var(--color-navy);
  color: var(--color-white);
  border-radius: 8px;
  padding: 32px 24px;
  text-align: center;
  margin-bottom: 24px;
}
.lead-cta-card h3 { color: var(--color-white); font-size: 1.4rem; }
.lead-cta-card > p { color: rgba(255,255,255,0.85); font-size: 1.05rem; }

/* Lead Form */
.lead-form-wrap {
  background: var(--color-white);
  border-radius: 8px;
  padding: 24px;
  text-align: left;
  margin-top: 20px;
}
.lead-form-wrap .form-input, .lead-form-wrap .form-select {
  background: var(--color-white);
}
.lead-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.lead-form-grid .form-group.full-width { grid-column: 1 / -1; }
.trust-signals {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--color-gray-200);
}
.trust-signal {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}
.trust-signal svg { flex-shrink: 0; }

/* Thank You State */
.thank-you {
  text-align: center;
  padding: 32px;
}
.thank-you h3 { color: var(--color-success); }
.thank-you p { color: var(--color-text-secondary); }

/* Content Preview */
.content-preview {
  padding: 48px 20px;
  max-width: 960px;
  margin: 0 auto;
}
.content-preview h2 { text-align: center; margin-bottom: 32px; }
.content-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.content-card {
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  transition: box-shadow 0.2s;
}
.content-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.content-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.content-card p { font-size: 0.9rem; color: var(--color-text-secondary); margin-bottom: 16px; }
.content-card .card-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  background: var(--color-off-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

/* Landing Page Layout */
.lp-layout .site-nav { display: none; }
.lp-layout .site-footer { display: none; }

.lp-hero {
  background: var(--color-navy);
  color: var(--color-white);
  text-align: center;
  padding: 60px 20px 48px;
}
.lp-hero h1 { color: var(--color-white); font-size: 2rem; max-width: 700px; margin: 0 auto 16px; }
.lp-subhead {
  font-size: 1.15rem;
  color: rgba(255,255,255,0.85);
  max-width: 560px;
  margin: 0 auto;
}

.lp-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 800px;
  margin: -24px auto 40px;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}
.stat-card {
  background: var(--color-white);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  padding: 20px 16px;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.4;
}

.lp-context {
  max-width: 680px;
  margin: 0 auto;
  padding: 40px 20px;
  text-align: center;
}
.lp-context h2 { margin-bottom: 16px; }
.lp-context p { color: var(--color-text-secondary); font-size: 1.05rem; }

.lp-social-proof {
  text-align: center;
  padding: 16px;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.lp-footer {
  text-align: center;
  padding: 32px 20px;
  border-top: 1px solid var(--color-gray-200);
  margin-top: 48px;
}
.lp-disclaimer {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  max-width: 600px;
  margin: 0 auto 12px;
  line-height: 1.5;
}
.lp-footer a {
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

/* Prevent sticky bar from obscuring page content */
body:has(.sticky-bottom-bar) { padding-bottom: 80px; }

/* Sticky Bottom Bar */
.sticky-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-white);
  box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
  padding: 12px 20px;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.sticky-bottom-bar p {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
}

/* Content Page Styles */
.content-page { padding: 40px 20px; max-width: 720px; margin: 0 auto; }
.content-page h1 { margin-bottom: 8px; }
.content-page .page-subtitle { color: var(--color-text-secondary); font-size: 1.05rem; margin-bottom: 32px; }
.content-page h2 { margin-top: 40px; border-bottom: 2px solid var(--color-gray-200); padding-bottom: 8px; }
.content-page ul, .content-page ol { margin: 0 0 1em 24px; }
.content-page li { margin-bottom: 8px; line-height: 1.6; }

/* Checklist */
.checklist { list-style: none; margin-left: 0; }
.checklist li {
  padding: 8px 0 8px 32px;
  position: relative;
  border-bottom: 1px solid var(--color-gray-100);
}
.checklist li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  width: 18px;
  height: 18px;
  border: 2px solid var(--color-gray-300);
  border-radius: 3px;
}

/* Questions List */
.question-list { counter-reset: question; list-style: none; margin-left: 0; }
.question-list li {
  counter-increment: question;
  padding: 16px 0 16px 48px;
  position: relative;
  border-bottom: 1px solid var(--color-gray-100);
  font-weight: 500;
}
.question-list li::before {
  content: counter(question);
  position: absolute;
  left: 0;
  top: 16px;
  width: 32px;
  height: 32px;
  background: var(--color-accent);
  color: var(--color-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
}
.question-list li p {
  font-weight: 400;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin-top: 4px;
}

/* Comparison Table */
.compare-table { width: 100%; border-collapse: collapse; margin: 20px 0; }
.compare-table th, .compare-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--color-gray-200); }
.compare-table th { background: var(--color-navy); color: var(--color-white); font-weight: 600; }
.compare-table tr:nth-child(even) { background: var(--color-gray-100); }

/* CTA Box */
.cta-box {
  background: var(--color-navy);
  color: var(--color-white);
  border-radius: 8px;
  padding: 32px;
  text-align: center;
  margin: 40px 0;
}
.cta-box h3 { color: var(--color-white); }
.cta-box p { color: rgba(255,255,255,0.85); margin-bottom: 20px; }

/* Alert/Info Box */
.info-box {
  background: #eff6ff;
  border-left: 4px solid var(--color-accent);
  padding: 16px 20px;
  border-radius: 0 6px 6px 0;
  margin: 20px 0;
}
.info-box p { margin: 0; }
.warning-box {
  background: #fef3c7;
  border-left: 4px solid var(--color-warning);
  padding: 16px 20px;
  border-radius: 0 6px 6px 0;
  margin: 20px 0;
}

/* Error State */
.form-error { color: var(--color-danger); font-size: 0.85rem; margin-top: 4px; }
.form-input.error { border-color: var(--color-danger); }

/* Loading Spinner */
.btn.loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}
.btn.loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-white);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Utility Classes */
.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.text-success { color: var(--color-success); }
.text-small { font-size: 0.85rem; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

/* Scrollbars */
::-webkit-scrollbar { width: 16px; height: 16px; }
::-webkit-scrollbar-track { background: var(--color-gray-100); }
::-webkit-scrollbar-thumb {
  background: var(--color-gray-300);
  border-radius: 8px;
  background-clip: padding-box;
  border: 3px solid transparent;
}
::-webkit-scrollbar-thumb:hover { background-color: var(--color-gray-500); }

/* Responsive */
@media (max-width: 768px) {
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.3rem; }
  .site-nav .nav-links { display: none; }
  .site-nav.nav-open .nav-links {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--color-white);
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-gray-200);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    gap: 12px;
  }
  .nav-hamburger { display: block; }
  .lp-stats { grid-template-columns: 1fr; }
  .content-grid { grid-template-columns: 1fr; }
  .lead-form-grid { grid-template-columns: 1fr; }
  .lp-hero { padding: 40px 20px 36px; }
  .lp-hero h1 { font-size: 1.6rem; }
  .hero { padding: 32px 20px; }
}
@media (max-width: 480px) {
  h1 { font-size: 1.4rem; }
  .calc-progress .step-dot { width: 28px; height: 28px; font-size: 0.7rem; }
  .calc-progress .step-line { width: 12px; }
  .age-display { font-size: 2rem; }
  .total-range .range-amount { font-size: 1.5rem; }
}
