@import url('https://fonts.googleapis.com/css2?family=Encode+Sans:wght@300;400;600;700&display=swap');

:root {
  --primary: #f97316;
  --primary-hover: #ea580c;
  --dark: #034383;
  --gray: #6b7280;
  --bg: #f9fafb;
  --card-bg: #ffffff;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Encode Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--dark);
  line-height: 1.6;
  overflow-x: hidden;
}

section {
  padding: 60px 20px;
  max-width: 1000px;
  margin: 0 auto;
  text-align: center;
  /* Center section headers and text by default */
}

h1,
h2,
h3 {
  margin: 0 auto 16px;
  line-height: 1.2;
  text-wrap: balance;
}

h1 {
  font-size: 36px;
  font-weight: 700;
}

h2 {
  font-size: 28px;
  font-weight: 600;
  color: var(--dark);
}

h3 {
  font-size: 20px;
  font-weight: 600;
}

p {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 16px;
  color: #4b5563;
}

/* Helper for 2x2 centered grid */
.grid-2x2 {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 420px));
  justify-content: center;
  gap: 24px;
  margin: 32px auto 0;
  text-align: left;
  /* Reset text align for card content */
}

@media (max-width: 768px) {
  .grid-2x2 {
    grid-template-columns: 1fr;
  }
}

.tax-grid-flex {
  display: flex !important;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  margin: 32px auto 0;
}

.tax-grid-flex .tax-card {
  width: calc(50% - 12px);
  max-width: 420px;
}

@media (max-width: 768px) {
  .tax-grid-flex .tax-card {
    width: 100%;
    max-width: none;
  }
}

/* Animations */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.show {
  opacity: 1;
  transform: none;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, #fff7ed, #ffffff);
  border-bottom-left-radius: 40px;
  border-bottom-right-radius: 40px;
  padding: 80px 20px 60px;
  text-align: center;
}

.hero h1 span {
  color: var(--primary);
  display: block;
}

/* Groups Grid */
.groups {
  margin-top: 32px;
}

.card {
  background: var(--card-bg);
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid transparent;
  width: 100%;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(249, 115, 22, 0.15);
  border-color: rgba(249, 115, 22, 0.2);
}

.card h3 {
  color: var(--primary);
  margin-bottom: 8px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
}

.card p {
  margin: 0;
  font-size: 15px;
  text-align: left;
  color: var(--gray);
}

.card-svg {
  width: 24px;
  height: 24px;
  margin-bottom: 0;
  flex-shrink: 0;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.card:hover .card-svg {
  transform: scale(1.3) rotate(10deg);
}

.card-svg .primary {
  fill: var(--primary);
}

.card-svg .dark {
  fill: var(--dark);
}

.card-svg .light {
  fill: #fed7aa;
}

/* Light orange */

/* Calculator Section */
#tax-calculator {
  background: linear-gradient(145deg, #ffffff, #fff7ed);
  border-radius: 24px;
  padding: 40px;
  box-shadow: var(--shadow);
  margin-top: 60px;
  margin-bottom: 60px;
  border: 1px solid rgba(249, 115, 22, 0.1);
  text-align: left;
  /* Keep calculator inputs left-aligned */
}

#tax-calculator h2 {
  text-align: center;
  color: var(--primary);
  margin-bottom: 32px;
}

.calculator-wrapper {
  max-width: 600px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--dark);
}

.form-control {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-size: 16px;
  font-family: inherit;
  transition: border-color 0.2s;
  background: #fff;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
}

.calc-btn {
  width: 100%;
  padding: 16px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.3s;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

.calc-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.result-box {
  margin-top: 32px;
  padding: 24px;
  background: #fff;
  border-radius: 16px;
  border-left: 5px solid var(--primary);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.badge {
  display: inline-block;
  padding: 6px 12px;
  background: #fff7ed;
  color: var(--primary);
  font-weight: 700;
  border-radius: 99px;
  font-size: 14px;
  margin-bottom: 12px;
}

.note {
  font-size: 14px;
  color: var(--gray);
  margin-top: 12px;
  font-style: italic;
  border-top: 1px solid #eee;
  padding-top: 12px;
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 40px;
  margin-top: 32px;
  text-align: left;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #e5e7eb;
}

.timeline-item {
  position: relative;
  margin-bottom: 40px;
}

.timeline-item::after {
  content: "";
  position: absolute;
  left: -33px;
  top: 6px;
  width: 10px;
  height: 10px;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 0 4px #fff7ed;
}

.timeline-item span {
  font-weight: 700;
  color: var(--primary);
  display: block;
  margin-bottom: 4px;
}

.timeline-item p {
  margin: 0;
  font-weight: 500;
}

/* Toggle & Tables */
.toggle-container {
  text-align: center;
  margin-bottom: 32px;
}

.toggle {
  display: inline-flex;
  background: #fff;
  border-radius: 999px;
  padding: 4px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  border: 1px solid #e5e7eb;
}

.toggle button {
  padding: 10px 24px;
  border: none;
  background: none;
  cursor: pointer;
  font-weight: 600;
  border-radius: 999px;
  font-family: inherit;
  color: var(--gray);
  transition: all 0.3s;
}

.toggle button.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 10px rgba(249, 115, 22, 0.3);
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 16px;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

th,
td {
  padding: 16px;
  border-bottom: 1px solid #f3f4f6;
  text-align: left;
}

th {
  background: #fff7ed;
  color: var(--primary);
  font-weight: 700;
}

/* Popup */
.popup {
  position: fixed;
  inset: 0;
  background: rgba(31, 41, 51, 0.8);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s;
}

.popup.open {
  opacity: 1;
}

.popup-content {
  background: #fff;
  width: 100%;
  max-width: 600px;
  padding: 32px;
  border-radius: 24px;
  position: relative;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-align: left;
}

.popup.open .popup-content {
  transform: scale(1);
}

.popup-close {
  position: absolute;
  top: 16px;
  right: 20px;
  cursor: pointer;
  font-size: 28px;
  color: var(--gray);
  transition: color 0.2s;
  line-height: 1;
}

.popup-close:hover {
  color: var(--primary);
}

/* SUPPLEMENTARY CONTENT STYLES */
.meta-source {
  font-size: 14px;
  color: var(--gray);
  margin-top: -10px;
  margin-bottom: 24px;
  font-style: italic;
  max-width: 600px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 24px;
  text-align: left;
}

.info-card {
  background: white;
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
}

.info-card h3 {
  margin-top: 0;
  border-bottom: 1px solid #f3f4f6;
  padding-bottom: 12px;
  margin-bottom: 16px;
  text-align: left;
}

.info-card ul,
.info-card ol {
  padding-left: 20px;
  margin-bottom: 0;
}

.info-card li {
  margin-bottom: 8px;
}

.note-box {
  background: #fff7ed;
  padding: 24px;
  border-radius: var(--radius);
  border: 1px dashed var(--primary);
  margin-bottom: 32px;
  text-align: left;
}

.note-box h3 {
  color: var(--primary);
  margin-top: 0;
  text-align: left;
}

.quote-box {
  background: var(--dark);
  color: white;
  padding: 32px;
  border-radius: var(--radius);
  font-size: 18px;
  font-style: italic;
  position: relative;
  margin: 0;
  text-align: center;
}

.quote-box::before {
  content: "“";
  font-size: 60px;
  position: absolute;
  top: -10px;
  left: 20px;
  opacity: 0.2;
}

.quote-box footer {
  display: block;
  text-align: right;
  font-size: 14px;
  margin-top: 16px;
  opacity: 0.8;
  font-style: normal;
  font-weight: 600;
}

/* NEW REDESIGNED TAX SECTION STYLES */
.tax-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
  text-align: center;
  margin-bottom: 12px;
}

.tax-sub {
  text-align: center;
  color: var(--gray);
  margin-bottom: 32px;
}

.tax-toggle {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 40px;
}

.tax-toggle button {
  border: 2px solid var(--primary);
  background: #fff;
  color: var(--primary);
  padding: 12px 24px;
  border-radius: 30px;
  cursor: pointer;
  font-weight: 700;
  transition: .3s;
  font-family: inherit;
}

.tax-toggle button.active,
.tax-toggle button:hover {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 15px rgba(249, 115, 22, 0.3);
}

.tax-section {
  display: none;
  animation: fadeUp .5s ease forwards;
}

.tax-section.active {
  display: block;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tax-grid {
  display: grid;
  gap: 24px;
}

.tax-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow);
  transition: .3s;
  overflow: hidden;
  text-align: left;
}

.tax-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.tax-card h4 {
  margin: 0 0 12px;
  color: var(--dark);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  text-align: left;
}

.tax-meta {
  font-size: 13px;
  color: var(--gray);
  margin-bottom: 16px;
  height: 2.8em;
  overflow: hidden;
}

.rate {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0;
}

.rate span {
  width: 85px;
  font-weight: 700;
  font-size: 13px;
}

.bar {
  flex: 1;
  height: 8px;
  background: #f1f5f9;
  border-radius: 10px;
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  background: var(--primary);
  border-radius: 10px;
  width: 0;
}

/* Animation trigger for bars */
.tax-section.active .bar i {
  transition: width 1s cubic-bezier(0.1, 0, 0.3, 1);
}

/* Responsive */
@media (max-width: 768px) {
  h1 {
    font-size: 28px;
  }

  h2 {
    font-size: 24px;
  }

  section {
    padding: 40px 16px;
  }

  .calc-grid {
    grid-template-columns: 1fr;
  }
}