:root {
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #2563eb;
  --accent2: #8b5cf6;
  --green: #10b981;
  --gold: #f59e0b;
  --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.08);
  --glass: rgba(255, 255, 255, 0.8);
  --border: rgba(0, 0, 0, 0.06);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-font-smoothing: antialiased; }

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Background mesh */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(37,99,235,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(139,92,246,0.08) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ─── NAV ─── */
nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 5%;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.logo, .footer-logo {
  font-family: 'Montserrat', sans-serif;
  font-size: 18px; font-weight: 900;
  color: #000;
  text-decoration: none;
}
.logo span, .footer-logo span { color: var(--accent2) !important; }
.logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff; box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}
.logo span { color: var(--text); }

.nav-links {
  display: flex; align-items: center; gap: 32px;
  list-style: none;
  font-size: 14px; font-weight: 500; color: var(--muted);
}
.nav-links a {
  text-decoration: none; color: var(--text); font-size: 14px; font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--accent); }

.nav-cta {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; padding: 10px 22px; border-radius: 100px;
  text-decoration: none; font-size: 14px; font-weight: 700;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}
.nav-cta:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3); }

/* ─── HERO ─── */
.hero {
  position: relative; z-index: 1;
  padding: 100px 5% 60px;
  text-align: center;
  background: radial-gradient(circle at top, rgba(139, 92, 246, 0.05), transparent);
}

.hero-badge {
  display: inline-block; padding: 8px 16px; border-radius: 100px;
  background: rgba(37, 99, 235, 0.08); color: var(--accent);
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 24px; border: 1px solid rgba(37, 99, 235, 0.1);
}

.hero h1 {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(36px, 6vw, 72px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -2px;
  margin-bottom: 22px;
  color: var(--text);
}
.hero h1 .highlight {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 18px; color: var(--muted); max-width: 600px;
  margin: 0 auto 40px; font-family: 'DM Sans', sans-serif;
}

.hero-stats {
  display: flex; justify-content: center; gap: 48px;
  flex-wrap: wrap; margin-bottom: 60px;
}
.stat { text-align: center; }
.stat-num {
  font-family: 'Montserrat', sans-serif;
  font-size: 28px; font-weight: 900;
  color: var(--text);
}
.stat-label { font-size: 12px; color: var(--muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.5px; }

/* ─── CALCULATOR ─── */
.calc-section {
  position: relative; z-index: 1;
  max-width: 1060px; margin: 0 auto;
  padding: 0 24px 100px;
}

.calc-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 32px;
  padding: 40px;
  max-width: 1100px;
  margin: 0 auto;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 40px;
}

.calc-header {
  display: flex; align-items: center; gap: 20px;
}
.calc-header-icon {
  width: 50px; height: 50px; background: rgba(139, 92, 246, 0.1); border-radius: 14px;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  color: var(--accent2);
}
.calc-header h2 {
  font-family: 'Montserrat', sans-serif;
  font-size: 20px; font-weight: 800;
}
.calc-header p { font-size: 13px; color: var(--muted); margin-top: 2px; }

.calc-body {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 40px;
}

/* LEFT: Inputs */
.calc-inputs {
  padding: 0;
}

.field { margin-bottom: 36px; }
.field:last-child { margin-bottom: 0; }

.field-top {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 14px;
}
.field-label {
  font-size: 13px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.8px;
}
.field-value {
  font-family: 'Montserrat', sans-serif;
  font-size: 22px; font-weight: 800; color: var(--text);
}
.field-value .currency { font-size: 15px; color: var(--accent2); margin-right: 2px; }
.field-value .unit { font-size: 14px; color: var(--muted); margin-left: 4px; }

/* Slider */
.slider-wrap { position: relative; padding: 8px 0; }

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px; border-radius: 99px;
  outline: none; cursor: pointer;
  background: #e2e8f0;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent);
  border: 4px solid #fff;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  cursor: grab; transition: transform 0.15s;
}
input[type="range"]::-webkit-slider-thumb:active { cursor: grabbing; transform: scale(1.1); }

.slider-marks {
  display: flex; justify-content: space-between;
  margin-top: 8px;
  font-size: 11px; color: var(--muted);
}

/* Fixed rate pill */
.rate-field {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 22px;
  display: flex; justify-content: space-between; align-items: center;
}
.rate-left { font-size: 13px; color: var(--muted); }
.rate-left strong { display: block; font-size: 15px; color: var(--text); font-weight: 600; margin-bottom: 2px; }
.rate-badge {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--accent);
  padding: 6px 14px; border-radius: 100px;
  font-family: 'Montserrat', sans-serif;
  font-size: 18px; font-weight: 800;
}

/* RIGHT: Results */
.calc-results {
  background: #f1f5f9;
  border-radius: 24px;
  padding: 32px;
  display: flex; flex-direction: column; gap: 32px;
}

.emi-display {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px 24px;
  text-align: center;
}
.emi-label {
  font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--muted); font-weight: 600; margin-bottom: 8px;
}
.emi-amount {
  font-family: 'Montserrat', sans-serif;
  font-size: 44px; font-weight: 900; line-height: 1;
  color: var(--text);
}
.emi-amount .emi-sym { font-size: 26px; }
.emi-sub { font-size: 12px; color: var(--muted); margin-top: 8px; }

/* Breakdown rows */
.breakdown {
  display: flex; flex-direction: column; gap: 12px;
}
.breakdown-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; border-radius: 12px;
  background: #fff;
  border: 1px solid var(--border);
}
.br-label {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--muted);
}
.br-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
}
.br-val {
  font-family: 'Montserrat', sans-serif;
  font-size: 16px; font-weight: 700; color: var(--text);
}

/* Donut chart */
.chart-wrap {
  display: flex; align-items: center; gap: 20px;
  padding: 20px; border-radius: 16px;
  background: #fff;
  border: 1px solid var(--border);
}
.donut-svg { flex-shrink: 0; }
.donut-circle-bg {
  fill: none; stroke: #e2e8f0;
  stroke-width: 10;
}
.donut-principal {
  fill: none; stroke: var(--accent);
  stroke-width: 10; stroke-linecap: round;
  transform-origin: center; transform: rotate(-90deg);
  transition: stroke-dashoffset 0.6s cubic-bezier(0.4,0,0.2,1);
}
.donut-interest {
  fill: none; stroke: var(--accent2);
  stroke-width: 10; stroke-linecap: round;
  transform-origin: center; transform: rotate(-90deg);
  transition: stroke-dashoffset 0.6s cubic-bezier(0.4,0,0.2,1);
}
.chart-legend { flex: 1; }
.legend-item { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.legend-item:last-child { margin-bottom: 0; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.legend-text { font-size: 12px; color: var(--muted); }
.legend-pct {
  font-family: 'Montserrat', sans-serif;
  font-size: 16px; font-weight: 700; color: var(--text); margin-left: auto;
}

/* CTA inside calc */
.calc-cta {
  display: block; text-align: center;
  padding: 16px; border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; font-weight: 700; font-size: 16px;
  text-decoration: none;
  transition: transform 0.3s, box-shadow 0.3s;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.2);
}
.calc-cta:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(37, 99, 235, 0.3); }


/* ─── FEATURES ─── */
.features {
  position: relative; z-index: 1;
  max-width: 1060px; margin: 0 auto;
  padding: 0 24px 100px;
}
.section-title {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 900; text-align: center;
  letter-spacing: -1px; margin-bottom: 12px;
}
.section-sub {
  text-align: center; color: var(--muted);
  font-size: 16px; max-width: 500px; margin: 0 auto 52px;
  line-height: 1.7;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.feat-card {
  padding: 32px; border-radius: 24px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  transition: transform 0.3s, box-shadow 0.3s;
  box-shadow: var(--shadow);
}
.feat-card:hover { transform: translateY(-8px); box-shadow: 0 20px 40px -10px rgba(0,0,0,0.1); }
.feat-icon {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; border-radius: 12px; margin-bottom: 24px;
  width: 52px; height: 52px; line-height: 52px; text-align: center;
  font-size: 24px;
}
.feat-card h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 17px; font-weight: 800; margin-bottom: 10px;
}
.feat-card p { font-size: 14px; color: var(--muted); line-height: 1.65; }

/* ─── FOOTER ─── */
footer {
  position: relative; z-index: 1;
  border-top: 1px solid var(--border);
  padding: 36px 48px;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 16px;
}
footer p { font-size: 13px; color: var(--muted); }

/* ─── Scroll animation ─── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate { opacity: 0; }
.animate.in { animation: fadeUp 0.6s ease forwards; }

/* ─── RESPONSIVE ─── */
@media (max-width: 860px) {
  nav { padding: 14px 20px; }
  .nav-links { display: none; }
  .hero { padding: 60px 20px 40px; }
  .calc-body { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  footer { flex-direction: column; text-align: center; padding: 28px 20px; }
  .calc-section, .features { padding-left: 16px; padding-right: 16px; }
  .calc-inputs, .calc-results { padding: 24px; }
}

/* ─── MODAL ─── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(10, 14, 26, 0.4);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }

.modal-content {
  background: #ffffff;
  width: 100%; max-width: 600px;
  max-height: 90vh;
  border-radius: 24px; padding: 40px;
  position: relative;
  display: flex; flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
  animation: modalIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
}

.lead-form { 
  margin-top: 20px;
  display: flex; flex-direction: column; gap: 24px;
}

/* Custom scrollbar for the modal */
.modal-content::-webkit-scrollbar { width: 6px; }
.modal-content::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 10px; }
.modal-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
.modal-content::-webkit-scrollbar-thumb:hover { background: var(--muted); }

.modal-close {
  position: absolute; top: 20px; right: 20px;
  background: #f1f5f9; border: none; font-size: 24px; color: var(--muted);
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
}
.modal-close:hover { color: var(--text); }

.modal-header { text-align: center; margin-bottom: 24px; }
.modal-icon-coin {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, #facc15, #eab308); /* Yellow Gold */
  color: #ffffff;
  border-radius: 50%;
  margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
  font-weight: 700;
  box-shadow: 0 10px 20px rgba(234, 179, 8, 0.3);
  border: 4px solid rgba(255, 255, 255, 0.2);
}
.modal-header h2 { font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: 900; margin-bottom: 8px; }
.modal-header p { font-size: 14px; color: var(--muted); line-height: 1.5; }

.modal-loan-summary {
  background: #f8fafc;
  border-radius: 16px; padding: 16px 20px;
  display: flex; justify-content: space-between;
  margin-bottom: 24px; border: 1px solid var(--border);
}
.summary-item { display: flex; flex-direction: column; gap: 4px; }
.summary-item span { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); }
.summary-item strong { font-family: 'Montserrat', sans-serif; font-size: 18px; color: var(--accent2); }


.form-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.input-group { display: flex; flex-direction: column; gap: 8px; }
.input-group label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.input-group input, .input-group select {
  background: #f8fafc; border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 16px;
  color: var(--text); font-family: inherit; font-size: 14px;
  transition: all 0.2s;
  outline: none; width: 100%;
}
.input-group input:focus, .input-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  background: #fff;
}
@media (max-width: 580px) {
  .modal-content { padding: 30px 20px; border-radius: 16px; }
  .form-grid { grid-template-columns: 1fr; gap: 12px; }
  .input-group { grid-column: span 1 !important; }
  .modal-loan-summary { 
    flex-direction: column; gap: 12px; text-align: center;
    padding: 12px;
  }
  .summary-item strong { font-size: 16px; }
  .modal-header h2 { font-size: 20px; }
  .submit-btn { padding: 14px; font-size: 15px; }
}

.submit-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; border: none; padding: 16px; border-radius: 12px;
  font-size: 16px; font-weight: 700; cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.2);
}
.submit-btn:hover { opacity: 0.9; }
.submit-btn:active { transform: scale(0.98); }

.form-disclaimer { font-size: 11px; color: var(--muted); text-align: center; line-height: 1.5; }

.footer-signature {
  font-size: 12px; color: var(--muted);
  display: flex; align-items: center; gap: 6px;
}
.footer-signature a {
  color: var(--accent2); text-decoration: none; font-weight: 700;
  transition: opacity 0.2s;
}
.footer-signature a:hover { opacity: 0.8; }

.success-state {
  text-align: center;
  padding: 40px 0;
  display: flex; flex-direction: column; align-items: center; gap: 20px;
}
.success-icon {
  width: 80px; height: 80px;
  background: #22c55e; color: #fff;
  border-radius: 50%; display: flex;
  align-items: center; justify-content: center;
  font-size: 40px; margin-bottom: 10px;
  box-shadow: 0 10px 20px rgba(34, 197, 94, 0.2);
}
.success-state h2 { font-family: 'Montserrat', sans-serif; font-weight: 900; color: var(--text); }
.success-state p { color: var(--muted); font-size: 15px; line-height: 1.6; }

/* ─── WHATSAPP FLOAT ─── */
.whatsapp-float {
  position: fixed; bottom: 32px; right: 32px;
  width: 64px; height: 64px; border-radius: 50%;
  background: #25D366;
  color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 24px rgba(37, 211, 102, 0.2);
  z-index: 1000; text-decoration: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.whatsapp-float:hover {
  transform: scale(1.1) translateY(-5px);
  box-shadow: 0 16px 32px rgba(37, 211, 102, 0.4);
}
.whatsapp-float svg { width: 32px; height: 32px; }

.wa-tooltip {
  position: absolute; right: 80px; top: 50%; transform: translateY(-50%);
  background: #fff; color: #0a0e1a; padding: 8px 16px;
  border-radius: 8px; font-size: 13px; font-weight: 700;
  white-space: nowrap; opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.whatsapp-float:hover .wa-tooltip {
  opacity: 1; transform: translateY(-50%) translateX(-10px);
}

@keyframes pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.4); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 20px rgba(37, 211, 102, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}
.whatsapp-float { animation: pulse 2s infinite; }

@media (max-width: 860px) {
  .whatsapp-float { bottom: 20px; right: 20px; width: 56px; height: 56px; }
  .wa-tooltip { display: none; }
}
