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

:root {
  --navy:        #1a2332;
  --navy-light:  #243044;
  --navy-mid:    #2d3c54;
  --saffron:     #FF8C00;
  --saffron-lt:  #FFA333;
  --saffron-bg:  #fff5e6;
  --white:       #ffffff;
  --gray-50:     #f8f9fa;
  --gray-100:    #f0f2f5;
  --gray-200:    #e2e6ea;
  --gray-400:    #9aa5b4;
  --gray-600:    #637282;
  --gray-800:    #2d3748;
  --green:       #22c55e;
  --green-bg:    #f0fdf4;
  --red:         #ef4444;
  --amber:       #f59e0b;
  --amber-bg:    #fffbeb;
  --blue:        #3b82f6;

  --font-body:   'Noto Sans', 'Segoe UI', Arial, sans-serif;
  --font-mono:   'Space Grotesk', 'Space Mono', monospace;

  --radius:      10px;
  --radius-lg:   16px;
  --shadow:      0 2px 8px rgba(0,0,0,0.10);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.13);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.16);
  --transition:  0.18s ease;
}

/* ─── Base ───────────────────────────────────────────────────────────────────── */
html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-body);
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--saffron); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--saffron-lt); text-decoration: underline; }

h1, h2, h3 {
  font-family: var(--font-mono);
  line-height: 1.25;
  color: var(--navy);
}

.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 16px;
}

.hidden { display: none !important; }

/* ─── Header / Nav ───────────────────────────────────────────────────────────── */
header {
  background: var(--navy);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  max-width: 1040px;
  margin: 0 auto;
  gap: 16px;
}

.nav-brand {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-brand .site-name {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.5px;
}

.nav-brand .site-name span { color: var(--saffron); }

.nav-brand .tagline {
  font-size: 0.72rem;
  color: var(--gray-400);
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 8px;
  list-style: none;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--gray-200);
  font-size: 0.875rem;
  padding: 6px 14px;
  border-radius: 6px;
  transition: background var(--transition), color var(--transition);
  font-weight: 500;
}

.nav-links a:hover {
  background: var(--navy-mid);
  color: var(--saffron);
  text-decoration: none;
}

/* ─── Countdown Timer ────────────────────────────────────────────────────────── */
.countdown-section {
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  padding: 36px 16px;
  text-align: center;
  border-bottom: 3px solid var(--saffron);
}

.countdown-section h2 {
  color: var(--white);
  font-size: 1.25rem;
  margin-bottom: 6px;
  font-family: var(--font-body);
  font-weight: 600;
}

.countdown-subtitle {
  color: var(--gray-400);
  font-size: 0.85rem;
  margin-bottom: 24px;
}

.countdown-boxes {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.countdown-box {
  background: var(--navy-mid);
  border: 2px solid var(--saffron);
  border-radius: var(--radius);
  padding: 18px 24px 12px;
  min-width: 90px;
  text-align: center;
  box-shadow: 0 0 20px rgba(255,140,0,0.15);
}

.countdown-box .count-num {
  font-family: var(--font-mono);
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--saffron);
  line-height: 1;
  display: block;
}

.countdown-box .count-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--gray-400);
  margin-top: 6px;
  display: block;
  font-weight: 600;
}

#deadline-label {
  color: var(--gray-200);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.deadline-table-wrapper {
  max-width: 700px;
  margin: 0 auto 16px;
  overflow-x: auto;
}

.deadline-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  color: var(--gray-200);
  text-align: left;
}

.deadline-table th {
  background: rgba(255,255,255,0.06);
  color: var(--saffron);
  padding: 8px 12px;
  font-weight: 600;
  white-space: nowrap;
}

.deadline-table td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  vertical-align: middle;
}

.deadline-table tr:last-child td { border-bottom: none; }
.deadline-table tr:hover td { background: rgba(255,255,255,0.04); }

.deadline-note {
  font-size: 0.78rem;
  color: var(--amber);
  margin-top: 12px;
}

.deadline-note a { color: var(--saffron-lt); }

/* ─── Main Content Area ──────────────────────────────────────────────────────── */
main { padding: 40px 0 60px; }

.page-intro {
  text-align: center;
  margin-bottom: 36px;
}

.page-intro h1 {
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  color: var(--navy);
  margin-bottom: 10px;
}

.page-intro p {
  color: var(--gray-600);
  max-width: 640px;
  margin: 0 auto;
  font-size: 1rem;
}

/* ─── Disclaimer Banner ──────────────────────────────────────────────────────── */
.disclaimer-banner {
  background: var(--amber-bg);
  border: 1.5px solid var(--amber);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 28px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.disclaimer-banner .disc-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.disclaimer-banner p {
  font-size: 0.84rem;
  color: #78350f;
  line-height: 1.5;
  margin: 0;
}

.disclaimer-banner a { color: #92400e; font-weight: 600; }

/* ─── Calculator Card ────────────────────────────────────────────────────────── */
.calculator-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 32px;
  margin-bottom: 32px;
}

.calculator-card h2 {
  font-size: 1.3rem;
  color: var(--navy);
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--gray-100);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-icon { font-size: 1.4rem; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.full-width { grid-column: 1 / -1; }

.form-group label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-group input[type="number"],
.form-group select {
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.95rem;
  font-family: var(--font-body);
  color: var(--gray-800);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}

.form-group input[type="number"]:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--saffron);
  box-shadow: 0 0 0 3px rgba(255,140,0,0.15);
}

.input-note {
  font-size: 0.76rem;
  color: var(--gray-400);
}

.error-msg {
  font-size: 0.8rem;
  color: var(--red);
  margin-top: 2px;
}

/* Tooltip */
.tooltip-icon {
  position: relative;
  display: inline-flex;
  cursor: help;
}

.tooltip-icon .tip-btn {
  background: var(--gray-200);
  color: var(--gray-600);
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  user-select: none;
}

.tooltip-text {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gray-800);
  color: var(--white);
  font-size: 0.78rem;
  padding: 8px 12px;
  border-radius: 6px;
  width: 240px;
  line-height: 1.5;
  z-index: 200;
  transition: opacity 0.15s;
  pointer-events: none;
  font-weight: 400;
}

.tooltip-text::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--gray-800);
}

/* Submit button */
.btn-calculate {
  width: 100%;
  margin-top: 8px;
  background: linear-gradient(135deg, var(--saffron), var(--saffron-lt));
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  padding: 16px 32px;
  font-size: 1.05rem;
  font-family: var(--font-mono);
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 14px rgba(255,140,0,0.35);
  transition: transform var(--transition), box-shadow var(--transition);
}

.btn-calculate:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255,140,0,0.45);
}

.btn-calculate:active { transform: translateY(0); }

.calc-note {
  background: var(--amber-bg);
  border-left: 4px solid var(--amber);
  padding: 12px 16px;
  border-radius: 0 8px 8px 0;
  font-size: 0.82rem;
  color: #78350f;
  line-height: 1.6;
  margin-top: 16px;
}

.calc-note a { color: #92400e; font-weight: 600; }

/* ─── Results Section ────────────────────────────────────────────────────────── */
#results { margin-top: 32px; }

.results-header {
  font-size: 1.4rem;
  margin-bottom: 24px;
  text-align: center;
}

/* Regime cards */
.regime-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}

.regime-card {
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.regime-card.recommended {
  border-color: var(--saffron);
  box-shadow: 0 0 0 2px rgba(255,140,0,0.15), var(--shadow-md);
}

.regime-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--saffron);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: 0.5px;
  box-shadow: var(--shadow);
}

.regime-card h3 {
  font-size: 1rem;
  color: var(--navy);
  margin-bottom: 16px;
}

.regime-card .big-amount {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--green);
  display: block;
  margin-bottom: 4px;
}

.regime-card .tax-amount {
  font-size: 0.875rem;
  color: var(--gray-600);
}

.regime-card .tax-amount span {
  font-weight: 600;
  color: var(--red);
}

.savings-banner {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border: 1.5px solid var(--green);
  border-radius: var(--radius);
  padding: 14px 20px;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 600;
  color: #15803d;
  margin-bottom: 28px;
}

/* Key metrics */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.metric-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--saffron);
}

.metric-card .metric-label {
  font-size: 0.8rem;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
  margin-bottom: 8px;
}

.metric-card .metric-value {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy);
}

/* Breakdown tables */
.breakdown-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}

.breakdown-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.breakdown-card .bd-header {
  background: var(--navy);
  color: var(--white);
  padding: 14px 20px;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
}

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

.breakdown-table td {
  padding: 10px 20px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: top;
}

.breakdown-table td:last-child {
  text-align: right;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--navy);
}

.breakdown-table .deduction td { color: var(--gray-600); }
.breakdown-table .deduction td:last-child { color: var(--red); }

.breakdown-table .total-row td {
  font-weight: 700;
  color: var(--navy);
  background: var(--gray-50);
  border-top: 2px solid var(--gray-200);
}

.breakdown-table .takehome-row td {
  font-weight: 700;
  font-size: 1rem;
  color: var(--green);
  background: var(--green-bg);
  border-top: 2px solid #bbf7d0;
}

.breakdown-table .takehome-row td:last-child { color: var(--green); }

/* Slab table */
.slab-section {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 28px;
  overflow: hidden;
}

.slab-section .section-title {
  background: var(--navy);
  color: var(--white);
  padding: 14px 20px;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
}

.slab-table-wrapper { overflow-x: auto; }

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

.slab-table th {
  background: var(--gray-50);
  padding: 10px 16px;
  text-align: left;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--gray-600);
  font-weight: 700;
  border-bottom: 2px solid var(--gray-200);
}

.slab-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--gray-100);
}

.slab-table tr.slab-applied { background: #fff9f0; }
.slab-table tr.slab-applied td { color: var(--gray-800); }

.slab-status {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.3px;
}

.slab-status.applied {
  background: rgba(255,140,0,0.15);
  color: var(--saffron);
}

.slab-status.not-reached {
  background: var(--gray-100);
  color: var(--gray-400);
}

/* Bar chart */
.chart-section {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 32px;
}

.chart-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 16px;
}

.bar-track {
  background: var(--gray-100);
  border-radius: 8px;
  height: 48px;
  display: flex;
  overflow: hidden;
  margin-bottom: 12px;
}

.bar-segment {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--white);
  transition: width 0.6s ease;
  min-width: 0;
  overflow: hidden;
}

#bar-takehome { background: linear-gradient(90deg, #16a34a, #22c55e); }
#bar-tax      { background: linear-gradient(90deg, var(--saffron), #f97316); }

.bar-legend {
  display: flex;
  gap: 20px;
  font-size: 0.83rem;
  flex-wrap: wrap;
}

.bar-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gray-600);
  font-weight: 500;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.dot-green  { background: var(--green); }
.dot-orange { background: var(--saffron); }

/* ─── Educational Content ────────────────────────────────────────────────────── */
.educational-section {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 40px;
  margin-bottom: 32px;
}

.educational-section h2 {
  font-size: 1.3rem;
  margin-top: 36px;
  margin-bottom: 14px;
  padding-top: 28px;
  border-top: 1px solid var(--gray-100);
  color: var(--navy);
}

.educational-section h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.educational-section p {
  font-size: 0.94rem;
  line-height: 1.75;
  color: var(--gray-600);
  margin-bottom: 14px;
}

.educational-section ul, .educational-section ol {
  font-size: 0.94rem;
  color: var(--gray-600);
  line-height: 1.75;
  padding-left: 24px;
  margin-bottom: 14px;
}

.educational-section li { margin-bottom: 4px; }

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin: 16px 0;
}

.comparison-table th {
  background: var(--navy);
  color: var(--white);
  padding: 10px 16px;
  text-align: left;
  font-weight: 600;
}

.comparison-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: top;
}

.comparison-table tr:nth-child(even) td { background: var(--gray-50); }

.highlight-box {
  background: var(--saffron-bg);
  border-left: 4px solid var(--saffron);
  padding: 14px 18px;
  border-radius: 0 8px 8px 0;
  margin: 14px 0;
  font-size: 0.9rem;
  color: #7c2d12;
  line-height: 1.6;
}

/* ─── References Section ─────────────────────────────────────────────────────── */
.references-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 28px 32px;
  margin-bottom: 32px;
}

.references-card h2 {
  font-size: 1.1rem;
  margin-bottom: 18px;
  color: var(--navy);
}

.ref-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ref-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
}

.ref-list li::before {
  content: '→';
  color: var(--saffron);
  font-weight: 700;
  flex-shrink: 0;
}

.ref-list a {
  color: var(--blue);
  font-weight: 500;
}

.ref-list .ref-desc {
  color: var(--gray-400);
  font-size: 0.82rem;
}

/* ─── Footer ─────────────────────────────────────────────────────────────────── */
footer {
  background: var(--navy);
  color: var(--gray-400);
  padding: 36px 16px 24px;
  font-size: 0.85rem;
}

.footer-inner {
  max-width: 1040px;
  margin: 0 auto;
}

.footer-disclaimer {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 16px 20px;
  font-size: 0.8rem;
  line-height: 1.65;
  color: var(--gray-400);
  margin-bottom: 24px;
}

.footer-disclaimer a { color: var(--saffron-lt); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.footer-links {
  display: flex;
  gap: 18px;
  list-style: none;
}

.footer-links a {
  color: var(--gray-400);
  font-size: 0.85rem;
}

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

/* ─── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .form-grid         { grid-template-columns: 1fr; }
  .regime-cards      { grid-template-columns: 1fr; }
  .breakdown-grid    { grid-template-columns: 1fr; }
  .metrics-row       { grid-template-columns: 1fr; }
  .countdown-boxes   { gap: 10px; }
  .countdown-box     { min-width: 72px; padding: 14px 16px 10px; }
  .countdown-box .count-num { font-size: 2rem; }
  .calculator-card   { padding: 20px 16px; }
  .educational-section { padding: 24px 16px; }
  .references-card   { padding: 20px 16px; }
  nav { flex-direction: column; align-items: flex-start; gap: 10px; }
  .nav-brand .tagline { white-space: normal; }
  .bar-track { height: 38px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .page-intro h1 { font-size: 1.3rem; }
  .metrics-row   { grid-template-columns: 1fr 1fr; }
  .metric-card:last-child { grid-column: 1 / -1; }
}
