/* ============================================================
   calculator.css — SIP Calculator Widget (Homepage)
   N Gram Technologies
   ============================================================ */

/* ─── CARD WRAPPER ─── */
.hero-visual {
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
.hero-visual {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 100%;
}
.hero-calc {
  background: var(--white);
  border-radius: 24px;
  box-shadow: 0 24px 64px rgba(15,45,110,.15), 0 4px 16px rgba(0,0,0,.06);
  padding: 28px 26px 22px;
  width: min(460px, 100%);
  max-width: 100%;
}
.hero-calc-title {
  font-family: var(--font-display);
  font-size: 17px; font-weight: 800;
  color: var(--text-main); margin-bottom: 3px;
}
.hero-calc-sub { font-size: 12.5px; color: var(--text-sub); margin-bottom: 22px; }

/* ─── SLIDER GROUPS ─── */
.hc-slider-group { margin-bottom: 16px; }
.hc-slider-top {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 10px; gap: 8px;
}
.hc-slider-label {
  font-size: 12.5px; font-weight: 600;
  color: var(--text-sub);
  display: flex; align-items: center; gap: 5px;
  flex: 1;
}

/* ─── NUMBER INPUTS ─── */
.hc-input::-webkit-outer-spin-button,
.hc-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.hc-input[type=number] { -moz-appearance: textfield; }
.hc-input {
  width: 96px; height: 40px;
  border: 1.5px solid #D1DDEF; border-radius: 9px;
  background: #F8FAFF;
  text-align: right;
  font-family: var(--font-display); font-size: 16px; font-weight: 700; color: #0F2D6E;
  padding: 0 10px;
  transition: border-color .15s, box-shadow .15s, background .15s;
  flex-shrink: 0;
}
.hc-input:hover { border-color: #93B4E8; background: #F0F7FF; }
.hc-input:focus {
  outline: none; background: #fff;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26,86,219,.13);
}
#hc-years-input { width: 62px; }

/* ─── RANGE SLIDER ─── */
.hc-range {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px; border-radius: 4px;
  background: var(--border); outline: none; cursor: pointer;
}
.hc-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--blue); border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(26,86,219,.35); cursor: pointer;
}
.hc-range::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--blue); border: 3px solid #fff; cursor: pointer;
}
.hc-range:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
.hc-range-limits {
  display: flex; justify-content: space-between;
  font-size: 10px; color: #94A3B8; margin-top: 4px;
}

/* ─── PREFIX / SUFFIX ─── */
.hc-prefix, .hc-suffix {
  font-family: var(--font-display);
  font-size: 15px; font-weight: 700; color: var(--navy);
  flex-shrink: 0;
}

/* ─── TOOLTIP ─── */
.info-tooltip {
  position: relative; display: inline-flex;
  align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--blue-light); color: var(--blue);
  font-size: 10px; font-weight: 700; cursor: help;
}
.tooltip-content {
  position: absolute; bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%);
  width: 220px; background: #0F172A; color: #fff;
  padding: 12px 14px; border-radius: 10px;
  font-size: 11.5px; line-height: 1.6; font-weight: 400;
  font-family: var(--font-body);
  opacity: 0; visibility: hidden; transition: .15s;
  z-index: 50; pointer-events: none; white-space: normal;
}
.tooltip-content::after {
  content: ''; position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: #0F172A;
}
.info-tooltip:hover .tooltip-content,
.info-tooltip:focus .tooltip-content { opacity: 1; visibility: visible; }
@media (max-width: 480px) {
  .tooltip-content { left: auto; right: -10px; transform: none; width: 190px; }
  .tooltip-content::after { left: auto; right: 18px; transform: none; }
}

/* ─── DIVIDER ─── */
.hc-divider { height: 1px; background: var(--border); margin: 8px 0 16px; }

/* ─── RESULTS PANEL ─── */
.hc-result {
  background: linear-gradient(135deg, var(--blue-light) 0%, var(--emerald-light) 100%);
  border-radius: var(--radius-md); padding: 16px 18px;
}
.hc-result-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.hc-result-label { font-size: 12px; color: var(--text-sub); }
.hc-result-val   {
  font-family: var(--font-display); font-size: 13px;
  font-weight: 700; color: var(--text-main);
}
.hc-result-main {
  border-top: 1px solid rgba(0,0,0,.07); padding-top: 12px;
  margin-top: 6px; display: flex;
  justify-content: space-between; align-items: flex-end;
  gap: 8px;
}
.hc-result-main-label { font-size: 11px; color: var(--text-sub); margin-bottom: 2px; }
.hc-result-main-gain  { font-size: 11px; font-weight: 600; color: var(--emerald); }
.hc-result-main-val   {
  font-family: var(--font-display); font-size: 26px;
  font-weight: 800; color: var(--navy); line-height: 1;
}

/* ─── DONUT ROW ─── */
.hc-donut-row {
  display: flex; align-items: center; gap: 12px;
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.hc-legend      { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 90px; }
.hc-legend-item { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-sub); }
.hc-legend-dot  { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ─── DISCLAIMER ─── */
.hc-disclaimer {
  font-size: 10px; color: #94A3B8;
  margin-top: 10px; line-height: 1.5;
}

/* ─── RESPONSIVE TWEAKS ─── */
@media (max-width: 380px) {
  .hero-calc { padding: 20px 16px 18px; }
  .hc-input  { width: 80px; font-size: 14px; }
  .hc-result-main-val { font-size: 22px; }
}

/* ─── RESPONSIVE: calculator below hero text on narrow screens ─── */
/* At ≤1100px the hero-grid already collapses to 1 column (layout.css).
   We just ensure the calc card is fully visible and scrollable. */
@media (max-width: 1100px) {
  .hero-visual {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    /* Remove any fixed height that could clip the card */
    height: auto !important;
    min-height: unset !important;
    overflow: visible !important;
  }
  .hero-calc {
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .hero-visual {
    max-width: 100%;
  }
  .hero-calc {
    padding: 22px 18px 18px;
  }
}
