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

:root {
  --primary-color: #1a365d;
  --primary-light: #2c5282;
  --accent-color: #e53e3e;
  --accent-light: #fc8181;
  --warning-color: #dd6b20;
  --success-color: #38a169;
  --text-color: #1a202c;
  --text-light: #4a5568;
  --bg-color: #ffffff;
  --bg-light: #f7fafc;
  --bg-dark: #edf2f7;
  --border-color: #e2e8f0;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

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

p {
  margin-bottom: 1rem;
  color: var(--text-light);
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Navigation */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  z-index: 1000;
  padding: 1rem 0;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

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

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

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

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

small {
  font-size: 0.875rem;
  color: white;
}

/* Hero Section */
.hero {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--primary-light) 100%
  );
  color: white;
  padding: 8rem 0 4rem;
  text-align: center;
  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='%23ffffff' fill-opacity='0.05'%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");
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1.5rem;
}

.hero .subtitle {
  font-size: 1.25rem;
  opacity: 0.9;
  max-width: 700px;
  margin: 0 auto 2rem;
  color: white !important;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
  padding-top: 3rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.stat {
  text-align: center;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  display: block;
}

.stat-label {
  font-size: 0.9rem;
  opacity: 0.8;
}

/* Section Styles */
section {
  padding: 5rem 0;
}

section:nth-child(even) {
  background-color: var(--bg-light);
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header h2 {
  color: var(--primary-color);
  position: relative;
  display: inline-block;
}

.section-header h2::after {
  content: "";
  position: absolute;
  bottom: -0.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--accent-color);
  border-radius: 2px;
}

.section-header p {
  max-width: 700px;
  margin: 1rem auto 0;
}

/* Cards */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.card {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: var(--shadow);
  transition: transform 0.3s, box-shadow 0.3s;
  border: 1px solid var(--border-color);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.card-icon {
  width: 48px;
  height: 48px;
  background: var(--bg-light);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.card h3 {
  color: var(--primary-color);
  margin-bottom: 0.75rem;
}

.card p {
  font-size: 0.95rem;
}

/* Alert Cards */
.alert-card {
  border-left: 4px solid var(--accent-color);
  background: #fff5f5;
}

.alert-card .card-icon {
  background: #fed7d7;
  color: var(--accent-color);
}

.warning-card {
  border-left: 4px solid var(--warning-color);
  background: #fffaf0;
}

.warning-card .card-icon {
  background: #feebc8;
  color: var(--warning-color);
}

/* Tables */
.table-container {
  overflow-x: auto;
  margin: 2rem 0;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

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

th {
  background: var(--primary-color);
  color: white;
  font-weight: 600;
}

tr:hover {
  background: var(--bg-light);
}

tr:last-child td {
  border-bottom: none;
}

/* Cost Calculator */
.calculator {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: var(--shadow);
  max-width: 600px;
  margin: 0 auto;
}

.calculator h3 {
  text-align: center;
  margin-bottom: 1.5rem;
}

.calc-result {
  text-align: center;
  padding: 1.5rem;
  background: var(--bg-light);
  border-radius: 8px;
  margin-top: 1.5rem;
}

.calc-result .amount {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent-color);
}

/* Timeline */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-color);
}

.timeline-item {
  position: relative;
  padding: 1.5rem 0;
  display: flex;
  gap: 2rem;
}

.timeline-item:nth-child(odd) {
  flex-direction: row-reverse;
  text-align: right;
}

.timeline-content {
  flex: 1;
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.timeline-dot {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  background: var(--primary-color);
  border-radius: 50%;
  border: 3px solid white;
  box-shadow: var(--shadow);
}

/* Groups Affected */
.affected-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.group-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  background: white;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.group-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.group-info h4 {
  margin-bottom: 0.25rem;
  color: var(--primary-color);
}

.group-info p {
  font-size: 0.9rem;
  margin: 0;
}

/* CTA Section */
.cta-section {
  background: linear-gradient(135deg, var(--accent-color) 0%, #c53030 100%);
  color: white;
  text-align: center;
  padding: 4rem 0;
}

.cta-section h2 {
  color: white;
  margin-bottom: 1rem;
}

.cta-section p {
  color: rgba(255, 255, 255, 0.9);
  max-width: 600px;
  margin: 0 auto 2rem;
}

.btn {
  display: inline-block;
  padding: 1rem 2rem;
  background: white;
  color: var(--accent-color);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: transform 0.3s, box-shadow 0.3s;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Footer */
footer {
  background: var(--primary-color);
  color: white;
  padding: 3rem 0;
  text-align: center;
}

footer p {
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0.5rem;
}

footer a {
  color: white;
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    flex-direction: column;
    padding: 1rem;
    box-shadow: var(--shadow);
  }

  .nav-links.active {
    display: flex;
  }

  .nav-toggle {
    display: block;
  }

  .hero h1 {
    font-size: 2rem;
  }

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

  .timeline::before {
    left: 0;
  }

  .timeline-item,
  .timeline-item:nth-child(odd) {
    flex-direction: column;
    text-align: left;
    padding-left: 2rem;
  }

  .timeline-dot {
    left: 0;
  }

  h1 {
    font-size: 2rem;
  }
  h2 {
    font-size: 1.5rem;
  }
  h3 {
    font-size: 1.25rem;
  }
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Elements start visible by default (fallback if JS fails) */
.card,
.group-item,
.timeline-content,
.table-container {
  opacity: 1;
}

/* When JS is ready, hide elements waiting for animation */
.js-ready .card:not(.animate-on-scroll),
.js-ready .group-item:not(.animate-on-scroll),
.js-ready .timeline-content:not(.animate-on-scroll),
.js-ready .table-container:not(.animate-on-scroll) {
  opacity: 0;
}

.animate-on-scroll {
  animation: fadeInUp 0.35s ease-out forwards;
}

/* Highlight Box */
.highlight-box {
  background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
  border: 2px solid var(--accent-color);
  border-radius: 12px;
  padding: 2rem;
  margin: 2rem 0;
}

.highlight-box h3 {
  color: var(--accent-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Price Table */
.price-comparison {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  text-align: center;
}

.price-year {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.price-year.current {
  border: 2px solid var(--primary-color);
  transform: scale(1.05);
}

.price-year h4 {
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.price-year .price {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-color);
}

.price-year .note {
  font-size: 0.85rem;
  color: var(--text-light);
}

@media (max-width: 600px) {
  .price-comparison {
    grid-template-columns: 1fr;
  }

  .price-year.current {
    transform: none;
  }
}
