/* =========================================================================
   Finversal Techlabs — calculator UI
   Slider + result layout shared by the EMI, FD, SIP, Lumpsum, NPS and SWP
   calculators. Loaded only on pages that contain a calculator block.
   ========================================================================= */

.fv-calc {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

/* ------------------------------------------------------------- inputs */

.fv-calc__inputs {
  display: flex;
  flex-direction: column;
  gap: 30px;
  padding: 32px;
  border-radius: var(--fv-r-2xl);
  background: #fff;
  border: 1px solid var(--fv-border);
  box-shadow: var(--fv-shadow-card);
}

.fv-calc__field { display: flex; flex-direction: column; gap: 12px; }

.fv-calc__field-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}

.fv-calc__label {
  font-size: 14.5px; font-weight: 600; color: var(--fv-body);
}

.fv-calc__value {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 8px 14px; border-radius: var(--fv-r-sm);
  background: var(--fv-surface-alt); border: 1px solid var(--fv-border);
  font-family: var(--fv-font-display); font-weight: 700; font-size: 16px;
  color: var(--fv-navy);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.fv-calc__value:focus-within {
  border-color: var(--fv-navy); background: #fff;
  box-shadow: 0 0 0 4px rgba(8, 34, 67, 0.12);
}
.fv-calc__affix { color: var(--fv-navy); }

.fv-calc__field input[type="text"] {
  width: 8ch; min-width: 0;
  border: 0; background: transparent; outline: none;
  font-family: inherit; font-weight: inherit; font-size: inherit;
  color: inherit; text-align: right;
  -moz-appearance: textfield;
}
.fv-calc__field input[type="text"].is-wide { width: 11ch; }

/* Range slider — the filled portion is painted from JS. */
.fv-calc__field input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px; border-radius: 999px;
  background: var(--fv-border); outline: none; cursor: pointer;
}
.fv-calc__field input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; border: 3px solid var(--fv-navy);
  box-shadow: 0 4px 12px rgba(8, 34, 67, 0.3);
  cursor: grab; transition: transform .15s ease;
}
.fv-calc__field input[type="range"]::-webkit-slider-thumb:active { transform: scale(1.12); cursor: grabbing; }
.fv-calc__field input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; border: 3px solid var(--fv-navy);
  box-shadow: 0 4px 12px rgba(8, 34, 67, 0.3);
  cursor: grab;
}
.fv-calc__field input[type="range"]::-moz-range-track { background: transparent; }

.fv-calc__bounds {
  display: flex; justify-content: space-between;
  font-size: 12px; font-weight: 500; color: var(--fv-faint);
}

/* ------------------------------------------------------------ results */

.fv-calc__results { display: flex; flex-direction: column; gap: 20px; }

.fv-calc__headline {
  position: relative; overflow: hidden;
  padding: 34px 32px; border-radius: var(--fv-r-2xl); color: #fff;
  background: linear-gradient(135deg, var(--fv-navy) 0%, var(--fv-navy-600) 55%, var(--fv-teal) 160%);
  box-shadow: 0 24px 50px -22px rgba(8, 34, 67, 0.6);
}
.fv-calc__headline::after {
  content: ""; position: absolute; top: -60%; right: -20%;
  width: 70%; height: 200%; border-radius: 50%;
  background: radial-gradient(circle at center, rgba(24, 155, 129, 0.35), transparent 65%);
  pointer-events: none;
}
.fv-calc__headline-label {
  position: relative; z-index: 1;
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: rgba(255, 255, 255, 0.72);
}
.fv-calc__headline-value {
  position: relative; z-index: 1; margin-top: 10px;
  font-family: var(--fv-font-display); font-weight: 800;
  font-size: clamp(34px, 4vw, 46px); line-height: 1.05; letter-spacing: -0.03em;
}
.fv-calc__headline-note {
  position: relative; z-index: 1; margin-top: 10px;
  font-size: 13.5px; color: rgba(255, 255, 255, 0.7);
}

.fv-calc__summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.fv-calc__summary--3 { grid-template-columns: repeat(3, 1fr); }

.fv-calc__stat {
  position: relative; overflow: hidden;
  padding: 20px; border-radius: var(--fv-r-xl);
  background: #fff; border: 1px solid var(--fv-border);
  box-shadow: var(--fv-shadow-card);
}
.fv-calc__stat::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--fv-navy), var(--fv-teal));
}
.fv-calc__stat-label { font-size: 12.5px; font-weight: 600; color: var(--fv-muted); }
.fv-calc__stat-value {
  margin-top: 8px;
  font-family: var(--fv-font-display); font-weight: 700; font-size: 21px;
  letter-spacing: -0.02em; color: var(--fv-ink);
}

/* --------------------------------------------------------- breakdown */

.fv-calc__chart {
  display: grid; grid-template-columns: 180px 1fr; gap: 24px; align-items: center;
  padding: 24px; border-radius: var(--fv-r-xl);
  background: #fff; border: 1px solid var(--fv-border);
  box-shadow: var(--fv-shadow-card);
}
.fv-calc__chart svg { display: block; width: 100%; height: auto; }

.fv-calc__legend { display: flex; flex-direction: column; gap: 14px; }
.fv-calc__legend-item { display: flex; align-items: center; gap: 10px; font-size: 14.5px; }
.fv-calc__legend-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.fv-calc__legend-label { color: var(--fv-body); }
.fv-calc__legend-value {
  margin-left: auto; font-family: var(--fv-font-display);
  font-weight: 700; color: var(--fv-ink);
}

.fv-calc__area {
  padding: 24px; border-radius: var(--fv-r-xl);
  background: #fff; border: 1px solid var(--fv-border);
  box-shadow: var(--fv-shadow-card);
}
.fv-calc__area svg { display: block; width: 100%; height: auto; overflow: visible; }
.fv-calc__area-title {
  font-family: var(--fv-font-display); font-weight: 700; font-size: 15px;
  color: var(--fv-ink); margin: 0 0 14px;
}

.fv-calc__disclaimer {
  font-size: 12.5px; line-height: 1.65; color: var(--fv-faint);
}

/* ------------------------------------------------- dark presentation */

.fv-section--dark .fv-calc__inputs,
.fv-calc--dark .fv-calc__inputs {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: none;
  backdrop-filter: blur(14px);
}
.fv-section--dark .fv-calc__label,
.fv-calc--dark .fv-calc__label { color: var(--fv-dark-lead); }
.fv-section--dark .fv-calc__value,
.fv-calc--dark .fv-calc__value {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff;
}
.fv-section--dark .fv-calc__affix,
.fv-calc--dark .fv-calc__affix { color: #fff; }
.fv-section--dark .fv-calc__bounds,
.fv-calc--dark .fv-calc__bounds { color: var(--fv-dark-meta); }
.fv-section--dark .fv-calc__stat,
.fv-section--dark .fv-calc__chart,
.fv-section--dark .fv-calc__area,
.fv-calc--dark .fv-calc__stat,
.fv-calc--dark .fv-calc__chart,
.fv-calc--dark .fv-calc__area {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: none;
}
.fv-section--dark .fv-calc__stat-value,
.fv-section--dark .fv-calc__legend-value,
.fv-section--dark .fv-calc__area-title,
.fv-calc--dark .fv-calc__stat-value,
.fv-calc--dark .fv-calc__legend-value,
.fv-calc--dark .fv-calc__area-title { color: #fff; }
.fv-section--dark .fv-calc__stat-label,
.fv-section--dark .fv-calc__legend-label,
.fv-calc--dark .fv-calc__stat-label,
.fv-calc--dark .fv-calc__legend-label { color: var(--fv-dark-lead); }

/* ---------------------------------------------------------- responsive */

@media (max-width: 960px) {
  .fv-calc { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .fv-calc__inputs { padding: 24px; }
  .fv-calc__summary, .fv-calc__summary--3 { grid-template-columns: 1fr; }
  .fv-calc__chart { grid-template-columns: 1fr; }
  .fv-calc__chart svg { max-width: 200px; margin: 0 auto; }
}
