/* ===== Reset & Base ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #e8590c;
  --primary-dark: #d94f00;
  --primary-light: #fff4e6;
  --accent: #1971c2;
  --accent-light: #e7f5ff;
  --success: #2f9e44;
  --success-light: #ebfbee;
  --text: #1a1b1e;
  --text-light: #495057;
  --text-muted: #868e96;
  --bg: #f8f9fa;
  --white: #ffffff;
  --border: #dee2e6;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --radius: 12px;
  --radius-sm: 8px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ===== Header ===== */
header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--primary);
}

/* ===== Hero ===== */
.hero {
  text-align: center;
  padding: 3rem 1.5rem 1.5rem;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto;
}

/* ===== Ad Slots ===== */
.ad-slot {
  max-width: 728px;
  margin: 1.5rem auto;
  min-height: 0;
  text-align: center;
}

/* ===== Calculator Section ===== */
.calculator-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

.calc-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 2rem;
  align-items: start;
}

/* ===== Input Panel ===== */
.input-panel {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  position: sticky;
  top: 80px;
}

.input-panel h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--text);
}

.input-group {
  margin-bottom: 1rem;
}

.input-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 0.35rem;
}

.input-group input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--white);
}

.input-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(232, 89, 12, 0.1);
}

.input-with-prefix, .input-with-suffix {
  position: relative;
}

.input-with-prefix .prefix {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-weight: 500;
}

.input-with-prefix input {
  padding-left: 1.75rem;
}

.input-with-suffix .suffix {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-weight: 500;
}

.input-with-suffix input {
  padding-right: 2rem;
}

.tooltip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: var(--border);
  color: var(--text-muted);
  border-radius: 50%;
  font-size: 0.65rem;
  font-weight: 700;
  cursor: help;
  position: relative;
  vertical-align: middle;
  margin-left: 4px;
}

.tooltip:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--white);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 400;
  white-space: normal;
  width: 220px;
  z-index: 10;
  line-height: 1.4;
}

/* ===== Results Panel ===== */
.results-panel {
  min-width: 0;
}

.results-panel h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.results-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.result-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.result-card.primary {
  background: var(--primary-light);
  border: 1.5px solid rgba(232, 89, 12, 0.15);
}

.result-card.highlight {
  background: var(--success-light);
  border: 1.5px solid rgba(47, 158, 68, 0.15);
}

.result-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.25rem;
}

.result-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}

.result-card.primary .result-value {
  color: var(--primary-dark);
}

.result-card.highlight .result-value {
  color: var(--success);
}

.result-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ===== FIRE Types ===== */
.fire-types {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.fire-types h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.fire-types-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.fire-type {
  text-align: center;
  padding: 1rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.fire-type.active {
  background: var(--primary-light);
  border: 1.5px solid rgba(232, 89, 12, 0.2);
}

.fire-type-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.fire-type-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  margin: 0.25rem 0;
}

.fire-type.active .fire-type-value {
  color: var(--primary-dark);
}

.fire-type-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ===== Coast FIRE ===== */
.coast-fire-section {
  background: var(--accent-light);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  border: 1.5px solid rgba(25, 113, 194, 0.12);
}

.coast-fire-section h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--accent);
}

.coast-fire-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.coast-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.coast-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent);
}

.coast-note {
  font-size: 0.8rem;
  color: var(--text-light);
  line-height: 1.5;
}

/* ===== Chart ===== */
.chart-container {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.chart-container h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.chart-container canvas {
  width: 100% !important;
  max-height: 350px;
}

/* ===== Milestones ===== */
.milestones {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.milestones h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.milestones-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.milestone {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.milestone-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.milestone-text {
  flex: 1;
  color: var(--text);
}

.milestone-year {
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

/* ===== Info Section ===== */
.info-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.info-section.alt-bg {
  max-width: none;
  background: var(--white);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.info-section.alt-bg > * {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.info-section h2 {
  font-size: 1.75rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 0.5rem;
}

.section-desc {
  text-align: center;
  color: var(--text-light);
  margin-bottom: 2rem;
  font-size: 1rem;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

.info-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  text-align: center;
}

.info-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.info-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.info-card p {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.5;
}

/* ===== Savings Table ===== */
.table-wrapper {
  overflow-x: auto;
}

.savings-table {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  border-collapse: collapse;
}

.savings-table th,
.savings-table td {
  padding: 0.75rem 1.25rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.savings-table th {
  background: var(--bg);
  font-weight: 700;
  color: var(--text);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.savings-table td:first-child {
  font-weight: 700;
}

.savings-table .highlight-row {
  background: var(--primary-light);
}

.savings-table .highlight-row td {
  font-weight: 700;
  color: var(--primary-dark);
}

/* ===== FAQ ===== */
.faq-list {
  max-width: 800px;
  margin: 2rem auto 0;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  background: var(--white);
  overflow: hidden;
}

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

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: '+';
  font-size: 1.25rem;
  font-weight: 300;
  color: var(--text-muted);
  transition: transform 0.2s;
}

.faq-item[open] summary::after {
  content: '−';
}

.faq-item p {
  padding: 0 1.25rem 1rem;
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.6;
}

/* ===== Footer ===== */
footer {
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  margin-top: 2rem;
}

.footer-content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

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

.footer-links a {
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
}

.footer-links a:hover {
  color: var(--primary);
}

.disclaimer {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.copyright {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .calc-grid {
    grid-template-columns: 1fr;
  }

  .input-panel {
    position: static;
  }

  .info-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .hero h1 {
    font-size: 1.75rem;
  }

  .hero-sub {
    font-size: 1rem;
  }

  .results-cards {
    grid-template-columns: 1fr;
  }

  .fire-types-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .fire-type {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    padding: 0.75rem 1rem;
  }

  .coast-fire-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .nav-links {
    gap: 1rem;
  }

  .nav-links a {
    font-size: 0.8rem;
  }
}
