body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: radial-gradient(circle at top, #1e1b4b, #020617);
  color: white;
}

/* CENTER */
.wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 80px;
}

/* HEADER */
.header {
  text-align: center;
  margin-bottom: 30px;
}

.header h1 {
  font-size: 32px;
  margin: 0;
}

.header p {
  font-size: 14px;
  opacity: 0.6;
}

.top-section {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 30px;
  margin-top: 30px;
  flex-wrap: wrap;
  /* important for mobile */
}

.top-section>div {
  height: 100%;
}

/* CARD */
.card {
  width: 420px;
  padding: 20px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
  margin-bottom: 20px;
  flex: 1;
  min-width: 320px;
  max-width: 420px;

}

/* RESULT */
.result-box {
  background: linear-gradient(135deg, #3b82f6, #22d3ee);
  padding: 25px;
  border-radius: 18px;
  text-align: center;
  margin-bottom: 30px;

  box-shadow: 0 10px 30px rgba(34, 211, 238, 0.3);
}

.result-box h2 {
  font-size: 42px;
  margin: 0;
}


.result-box span {
  font-size: 14px;
  opacity: 0.9;
}

/* INPUT */
.input-group {
  margin-top: 25px;
  margin-bottom: 25px;
}

.input-group label {
  font-size: 17px;
  opacity: 0.7;
}

.value {
  font-size: 20px;
  font-weight: 600;
  margin: 8px 0;
}

/* SLIDER */
input[type=range] {
  width: 100%;
  height: 6px;
  border-radius: 10px;
  background: #334155;
  outline: none;
  appearance: none;
  transition: background 0.3s ease;
}

/* THUMB */
input[type=range]::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  background: #22d3ee;
  border-radius: 50%;
  cursor: pointer;
  /*box-shadow: 0 0 10px rgba(34, 211, 238, 0.8);*/
  box-shadow:
    0 0 0 4px rgba(34, 211, 238, 0.15),
    0 0 12px rgba(34, 211, 238, 0.6);
}

/* Firefox */
input[type=range]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #22d3ee;
}

.content {
  width: 90%;
  max-width: 900px;  
  margin: 60px auto;
   padding: 25px;
  /*padding-top: 15px;
  padding-bottom: 25px;
  padding-left: 25px;
  padding-right: 25px;*/
  border-radius: 25px;

  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);

  line-height: 1.6;
}

.content p {
  color: #cbd5f5;
  font-size: 15px;
}

.content h3 {
  margin-top: 20px;
  margin-bottom: 10px;
  color: #22d3ee;
  font-size: 18px;
}

.content ul {
  padding-left: 18px;
}

.content li {
  margin-bottom: 8px;
}

.content h3 {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 5px;
}

.content p,
.content h3 {
  margin-bottom: 12px;
}

.content a {
  color: #22d3ee;
  text-decoration: none;
  transition: 0.3s;
  color: #22d3ee;
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  background: rgba(34, 211, 238, 0.1);
  transition: 0.3s;
}

.content a:hover {
  color: #38bdf8;
  text-decoration: underline;
  background: rgba(34, 211, 238, 0.25);
}

.breakdown {
  width: 480px;
  padding: 25px;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* 🔥 center everything */
}

.breakdown h2 {
  margin-bottom: 15px;
}

.card:hover,
.breakdown:hover,
.table-section:hover {
  transform: translateY(-5px);
  transition: 0.3s;
}

.breakdown canvas {
  max-width: 220px;
  margin: 0 auto;
}

.info {
  color: #22d3ee;
  font-size: 13px;
}

.info:hover {
  color: #38bdf8;
  text-decoration: underline;
}

.summary {
  width: 100%;
  margin-top: 20px;
}

.summary div {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  font-size: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.summary span {
  color: #cbd5f5;
}

.summary strong {
  color: white;
  font-weight: 600;
}

.summary div:hover {
  background: rgba(255, 255, 255, 0.03);
}

#emiChart {
  height: 220px !important;
  /* 🔥 reduce from 250 */
  max-width: 320px;
  margin: 0 auto;
}

.table-section {
  width: 90%;
  max-width: 900px;
  margin: 60px auto;
  padding: 25px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.table-wrapper {
  overflow-x: auto;
  margin-top: 20px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table-wrapper {
  max-height: 400px;
  overflow-y: auto;
}

th,
td {
  padding: 10px;
  text-align: center;
}

th {
  color: #22d3ee;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.download-btn {
  width: 100%;
  margin-top: 15px;
  padding: 12px;
  border-radius: 12px;
  border: none;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;

  background: linear-gradient(135deg, #22d3ee, #3b82f6);
  color: white;

  transition: all 0.2s ease;
}

.download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(34, 211, 238, 0.3);
}

.year-block {
  margin-bottom: 15px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
}

.year-header {
  padding: 14px 16px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: space-between;
  font-weight: 600;
}

.year-header:hover {
  background: rgba(255, 255, 255, 0.1);
}

.year-content {
  display: none;
  padding: 10px;
}

.year-content table {
  width: 100%;
  border-collapse: collapse;

}

.table-section .table-header {
  display: flex;
  justify-content: space-between;
  /* 🔥 key change */
  align-items: center;
  margin-bottom: 20px;
}

.table-section .table-header h2 {
  margin: 0;
}

/* button */
.table-section .table-header .download-btn {
  width: auto;
  padding: 8px 14px;
  font-size: 13px;
  border-radius: 8px;
  margin-top: 0;
}

.content ul li a {
  display: inline-block;
  margin: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  background: rgba(34, 211, 238, 0.1);
  transition: 0.3s;
}

.content ul li a:hover {
  background: rgba(34, 211, 238, 0.25);
}

.card,
.breakdown,
.table-section,
.content {
  margin-bottom: 30px;
}

body.home-loan {
  background: linear-gradient(135deg, #0f172a, #067057);
}

body.car-loan {
  background: linear-gradient(135deg, #0f172a, #1e3a8a);
}

body.personal-loan {
  background: linear-gradient(135deg, #0f172a, #3b0764);
}

body.ten-lakh {
  background: linear-gradient(135deg, #0f172a, #36640b);
}

body.five-lakh {
  background: linear-gradient(135deg, #0f172a, #7e3622);
}

body.two-lakh {
  background: linear-gradient(135deg, #0f172a, #726d21);
}

body.three-lakh {
  background: linear-gradient(135deg, #0f172a, #752556);
}

.navbar {
  display: flex;
  justify-content: center;
  gap: 25px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
}

.navbar a {
  color: #cbd5f5;
  text-decoration: none;
  font-size: 14px;
}

.navbar a:hover {
  color: #22d3ee;
}

@media (max-width: 768px) {
  .top-section {
    /*flex-direction: column;*/
    gap: 20px;
  }

  .card,
  .breakdown {
    width: 100%;
  }
}

/* ================= MOBILE FIX ================= */
@media (max-width: 768px) {

  /* GLOBAL SPACING */
  .wrapper {
    margin-top: 40px;
    padding: 10px;
  }

  /* HEADER */
  .header h1 {
    font-size: 24px;
  }

  .header p {
    font-size: 12px;
  }

  /* NAVBAR FIX */
  .navbar {
    overflow-x: auto;
    justify-content: flex-start;
    gap: 15px;
    padding: 10px;
  }

  .navbar a {
    white-space: nowrap;
    font-size: 13px;
  }

  /* CARD FIX */
  .card {
    width: 100% !important;
    padding: 20px;
    border-radius: 18px;
  }

  /* RESULT BOX */
  .result-box h2 {
    font-size: 32px;
  }

  /* INPUT TEXT */
  .value {
    font-size: 18px;
  }

  /* BREAKDOWN SECTION */
  .breakdown {
    width: 100% !important;
    padding: 15px;
  }

  .breakdown h2 {
    font-size: 20px;
    text-align: center;
  }

  /* CHART FIX */
  #emiChart {
    height: 180px !important;
    max-width: 200px;
  }

  /* SUMMARY FIX */
  .summary div {
    font-size: 13px;
    padding: 8px 0;
  }

  /* TABLE SECTION */
  .table-section {
    padding: 15px;
  }

  /* HEADER + DOWNLOAD BUTTON STACK */
  .table-section .table-header {
    flex-direction: column;
    gap: 10px;
    align-items: center;
  }

  .table-section .table-header .download-btn {
    width: auto;
  }

  /* CONTENT FIX */
  .content {
    /*width: 100%;*/
    padding: 15px;
  }

  .content h2 {
    font-size: 20px;
  }

  .content p {
    font-size: 14px;
  }

  /* LINKS WRAP BETTER */
  .content ul li a {
    display: block;
    margin: 6px 0;
    text-align: center;
  }

  /* FOOTER FIX */
  .content a {
    margin: 4px;
    font-size: 13px;
  }

}

.value-input {
  width: 120px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 8px;
  padding: 6px 10px;
  color: white;
  font-size: 20px;
  font-weight: 600;
  outline: none;
  transition: 0.3s;
}

.value-input.error {
  border: 2px solid #ff4d4f;
  background: rgba(255, 77, 79, 0.1);
}

.error-text {
  color: #ff4d4f;
  font-size: 12px;
  margin-top: 5px;
  display: none;
}

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #ff4d4f;
  color: white;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 14px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 9999;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Chrome, Safari, Edge */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
input[type="number"] {
  -moz-appearance: textfield;
}

.more-links a {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  background: rgba(34, 211, 238, 0.1);
  transition: 0.3s;
  text-decoration: none;
}

.more-links a:hover {
  background: rgba(34, 211, 238, 0.25);
}

input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.affiliate-inline {
  margin-top: 15px;
  text-align: center;
  color: #cbd5f5;
}

.affiliate-inline a {
  color: #38bdf8;
  font-weight: bold;
  text-decoration: none;
}

.cta-main {
  margin-top: 15px;
  padding: 18px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0f172b, #1e293b);
  border: 1px solid rgba(56, 189, 248, 0.3);
  text-align: center;
}

.cta-main h3 {
  font-size: 18px;
  color: #b4b22b;
  margin-bottom: 5px;
  margin-top: auto;
}

.cta-main p {
  font-size: 14px;
  color: #cbd5f5;
  margin-bottom: 12px;
}

.cta-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.btn-green {
  flex: 1;
  padding: 12px;
  background: linear-gradient(90deg, #1e1b4b, #020617);
  color: white;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
}

.btn-blue {
  flex: 1;
  padding: 12px;
  background: linear-gradient(90deg, #1e1b4b, #020617); 
  color: white;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
}

.btn-green:hover,
.btn-blue:hover {
  transform: translateY(-4px) scale(1.04);
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.cta-breakdown {
  margin-top: 20px;
  /*padding: 20px;*/
  padding-top: 10px;
  padding-bottom: 30px;
  padding-left: 30px;
  padding-right: 30px;
  background: rgba(34, 211, 238, 0.1);
  border-radius: 12px;
  text-align: center;
}
.sticky-cta {
  position:fixed;
  bottom: 20px;
  left: 80%;
  transform: translateX(-50%);

  background: rgba(15, 25, 50, 0.6);
  backdrop-filter: blur(12px);

  padding: 14px 22px;
  border-radius: 12px;

  font-weight: 600;
  color: white;

  transition: all 0.4s ease;
  z-index: 999;

  box-shadow: 0 8px 25px rgba(0,0,0,0.25);
}

/* Hidden state */
.sticky-hidden {
  transform: translate(-50%, 120%);
  opacity: 0;
}

.cta-content {
  margin: 20px 0;
  padding: 15px;
  border-radius: 12px;
  background: rgba(34, 211, 238, 0.08);
  text-align: center;
}

.cta-btn {
  position: relative;
  transition: all 0.3s ease;
}

/* Hover effect */
.cta-btn:hover {
  transform: translateY(-4px) scale(1.04);
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

/* Pulse animation */
@keyframes pulseGlow {
  0% { box-shadow: 0 0 0 0 rgba(0, 195, 255, 0.6); }
  70% { box-shadow: 0 0 0 14px rgba(0, 110, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 89, 255, 0); }
}

.cta-pulse {
  animation: pulseGlow 2s ease-out;
}