/* ==========================================================================
   GoodCap Capital — EMI Calculator (Phase 17)
   Compact hero · 55/45 calculator card · breakdown · schedule · learn · FAQ
   ========================================================================== */

.emi-wrap { max-width: 1180px; }

/* fade-up used by hero + card (same feel as other internal pages) */
.emi-in { opacity: 0; transform: translateY(16px); animation: emi-up .7s var(--ease) forwards; animation-delay: var(--d, 0s); }
@keyframes emi-up { to { opacity: 1; transform: none; } }

/* ---------- Hero (kept short) ---------- */
.emi-hero { padding: clamp(24px, 4vw, 44px) 0 clamp(84px, 9vw, 120px); }
.emi-hero__row { display: grid; gap: 18px 40px; margin-top: 14px; align-items: end; }
@media (min-width: 960px) { .emi-hero__row { grid-template-columns: minmax(0, 1fr) auto; } }
.emi-hero .pill { margin-bottom: 4px; }
.emi-hero h1 { margin: 12px 0 10px; }
.emi-hero .lead { max-width: 60ch; }
.emi-hero__note { margin-top: 8px; color: var(--gc-muted); font-size: 0.9375rem; }
.emi-hero__chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
@media (min-width: 960px) { .emi-hero__chips { flex-direction: column; align-items: flex-start; } }
.emi-hero__chips li { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--gc-line-blue); font-size: 0.875rem; font-weight: 700; color: var(--gc-navy); box-shadow: var(--sh-sm); }
.emi-hero__chips .icon { width: 16px; height: 16px; color: var(--gc-blue); }

/* ---------- Calculator card ---------- */
.emi-main { position: relative; z-index: 2; margin-top: clamp(-96px, -8vw, -64px); }
.emi-card { position: relative; display: grid; background: #fff; border: 1px solid var(--gc-line-blue); border-radius: clamp(24px, 3vw, 32px); box-shadow: 0 40px 90px -36px rgba(6, 50, 129, 0.35); overflow: hidden; }
@media (min-width: 960px) { .emi-card { grid-template-columns: minmax(0, 55fr) minmax(0, 45fr); } }

.emi-inputs { display: grid; gap: clamp(22px, 3vw, 30px); padding: clamp(22px, 4vw, 44px); align-content: start; }
.emi-field { min-width: 0; }
.emi-field__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 14px; }
.emi-field__label { display: inline-flex; align-items: center; gap: 10px; font-size: 1rem; font-weight: 800; color: var(--gc-ink); }
.emi-field__label .icon { width: 34px; height: 34px; padding: 8px; border-radius: 10px; background: var(--gc-tint); color: var(--gc-blue); }

/* number box with ₹ / % / Yrs affix */
.emi-box { display: inline-flex; align-items: center; height: 50px; min-width: 0; border: 1.5px solid var(--gc-line-blue); border-radius: 14px; background: var(--gc-mist); transition: border-color .2s, box-shadow .2s, background-color .2s; }
.emi-box:focus-within { border-color: var(--gc-blue); background: #fff; box-shadow: 0 0 0 4px rgba(2, 128, 231, 0.14); }
.emi-box__affix { padding: 0 4px 0 14px; font-weight: 800; color: var(--gc-navy); }
.emi-box__affix--end { padding: 0 14px 0 4px; color: var(--gc-muted); font-weight: 700; font-size: 0.875rem; white-space: nowrap; }
.emi-box__input { width: 9.5ch; min-width: 0; height: 100%; padding: 0 12px 0 4px; border: 0; background: transparent; font: inherit; font-size: 1.125rem; font-weight: 800; color: var(--gc-ink); text-align: right; font-variant-numeric: tabular-nums; }
.emi-box__input:focus { outline: none; }
[data-field="amount"] .emi-box__input { width: 11ch; }
[data-field="rate"] .emi-box__input, .emi-box--sm .emi-box__input { width: 5ch; padding-left: 12px; }
.emi-field.is-invalid .emi-box { border-color: var(--gc-error); box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1); }

.emi-field__tenure { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.emi-seg { display: inline-flex; padding: 4px; border-radius: 12px; background: var(--gc-mist); border: 1px solid var(--gc-line-blue); }
.emi-seg button { min-height: 40px; min-width: 64px; padding: 0 12px; border-radius: 9px; font-weight: 700; font-size: 0.875rem; color: var(--gc-muted); transition: background-color .2s, color .2s, box-shadow .2s; }
.emi-seg button[aria-checked="true"] { background: #fff; color: var(--gc-navy); box-shadow: var(--sh-sm); }
.emi-seg button:focus-visible { outline: 2px solid var(--gc-blue); outline-offset: 2px; }

/* range slider (filled track via --fill) */
.emi-range { --fill: 50%; width: 100%; height: 32px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; touch-action: pan-y; }
.emi-range:focus { outline: none; }
.emi-range::-webkit-slider-runnable-track { height: 8px; border-radius: 99px; background: linear-gradient(90deg, var(--gc-royal), var(--gc-cyan)) 0 / var(--fill) 100% no-repeat, #dbe8f7; }
.emi-range::-moz-range-track { height: 8px; border-radius: 99px; background: #dbe8f7; }
.emi-range::-moz-range-progress { height: 8px; border-radius: 99px; background: linear-gradient(90deg, var(--gc-royal), var(--gc-cyan)); }
.emi-range::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -9px; border-radius: 50%; background: #fff; border: 3px solid var(--gc-blue); box-shadow: 0 4px 12px rgba(2, 128, 231, 0.35); transition: transform .15s var(--ease); }
.emi-range::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 3px solid var(--gc-blue); box-shadow: 0 4px 12px rgba(2, 128, 231, 0.35); }
.emi-range:hover::-webkit-slider-thumb { transform: scale(1.08); }
.emi-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 6px rgba(2, 128, 231, 0.22); }
.emi-range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 6px rgba(2, 128, 231, 0.22); }
.emi-field__scale { display: flex; justify-content: space-between; margin-top: 2px; font-size: 0.8125rem; font-weight: 600; color: var(--gc-muted); }
.emi-field__hint { margin-top: 6px; font-size: 0.8125rem; font-weight: 700; color: var(--gc-blue); min-height: 1.2em; }
.emi-field__error { display: none; margin-top: 6px; font-size: 0.8125rem; font-weight: 700; color: var(--gc-error); }
.emi-field.is-invalid .emi-field__error { display: block; }
.emi-field.is-invalid .emi-field__hint { display: none; }

.emi-presets { display: flex; gap: 8px; margin-top: 12px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.emi-presets::-webkit-scrollbar { display: none; }
.emi-presets button { flex-shrink: 0; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--gc-line-blue); background: #fff; font-size: 0.875rem; font-weight: 700; color: var(--gc-navy); transition: border-color .2s, background-color .2s, color .2s; }
.emi-presets button:hover { border-color: var(--gc-blue); color: var(--gc-blue); }
.emi-presets button[aria-pressed="true"] { background: var(--gc-navy); border-color: var(--gc-navy); color: #fff; }

.emi-reset { justify-self: start; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; margin-left: -14px; border-radius: 12px; font-weight: 700; color: var(--gc-muted); }
.emi-reset:hover { color: var(--gc-blue); background: var(--gc-mist); }
.emi-reset .icon { width: 17px; height: 17px; }

/* ---------- Results ---------- */
.emi-results { position: relative; display: grid; align-content: start; justify-items: center; text-align: center; gap: 4px; padding: clamp(24px, 4vw, 44px); background: linear-gradient(160deg, #eef7ff 0%, #f6faff 55%, #e4f2ff 100%); border-top: 1px solid var(--gc-line-blue); min-width: 0; }
@media (min-width: 960px) { .emi-results { border-top: 0; border-left: 1px solid var(--gc-line-blue); } }
.emi-results__label { font-size: 0.9375rem; font-weight: 800; color: var(--gc-navy); letter-spacing: 0.01em; }
.emi-results__emi { font-size: clamp(2.4rem, 6vw, 3.5rem); font-weight: 800; letter-spacing: -0.035em; line-height: 1.1; color: var(--gc-navy); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; transition: opacity .18s; }
.emi-results__emi.is-tick { animation: emi-tick .22s ease; }
@keyframes emi-tick { from { opacity: .55; } to { opacity: 1; } }
.emi-results__per { font-size: 0.875rem; color: var(--gc-muted); font-weight: 600; }

.emi-donut { position: relative; width: min(210px, 62vw); aspect-ratio: 1; margin: 18px 0 14px; }
.emi-donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.emi-donut circle { fill: none; stroke-width: 16; }
.emi-donut__track { stroke: #dbe8f7; }
.emi-donut__principal { stroke: var(--gc-royal); stroke-dasharray: 100 100; transition: stroke-dasharray .45s var(--ease); }
.emi-donut__interest { stroke: var(--gc-cyan); stroke-dasharray: 0 100; stroke-dashoffset: 0; transition: stroke-dasharray .45s var(--ease), stroke-dashoffset .45s var(--ease); }
.emi-donut__center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.emi-donut__center b { font-size: 1.5rem; font-weight: 800; color: var(--gc-ink); line-height: 1; }
.emi-donut__center small { margin-top: 4px; font-size: 0.75rem; font-weight: 700; color: var(--gc-muted); text-transform: uppercase; letter-spacing: 0.08em; }

.emi-results__list { width: 100%; max-width: 420px; margin: 0; display: grid; gap: 8px; text-align: left; }
.emi-results__list > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-radius: 14px; background: #fff; border: 1px solid var(--gc-line-blue); min-width: 0; }
.emi-results__list dt { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--gc-text); font-size: 0.9375rem; }
.emi-results__list dd { margin: 0; text-align: right; font-weight: 800; color: var(--gc-ink); font-variant-numeric: tabular-nums; }
.emi-results__list dd small { display: block; font-size: 0.75rem; font-weight: 700; color: var(--gc-muted); }
.emi-results__list .is-total { background: var(--gc-navy); border-color: var(--gc-navy); }
.emi-results__list .is-total dt, .emi-results__list .is-total dd { color: #fff; }
.emi-key { width: 12px; height: 12px; border-radius: 4px; flex-shrink: 0; }
.emi-key--p { background: var(--gc-royal); }
.emi-key--i { background: var(--gc-cyan); }
.emi-results__note { display: flex; gap: 8px; align-items: flex-start; max-width: 420px; margin-top: 14px; font-size: 0.8125rem; color: var(--gc-muted); text-align: left; line-height: 1.55; }
.emi-results__note .icon { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; color: var(--gc-blue); }
.emi-card.is-stale .emi-results__emi, .emi-card.is-stale .emi-results__list { opacity: .5; }

/* ---------- Breakdown + schedule ---------- */
.emi-detail { padding-top: clamp(36px, 5vw, 56px); }
.emi-detail__grid { display: grid; gap: clamp(18px, 2.4vw, 24px); }
@media (min-width: 1180px) { .emi-detail__grid { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.6fr); align-items: start; } }
.emi-panel { background: #fff; border: 1px solid var(--gc-line-blue); border-radius: 24px; padding: clamp(20px, 3vw, 28px); box-shadow: var(--sh-md); min-width: 0; transition: box-shadow .3s var(--ease); }
.emi-panel__title { display: flex; align-items: center; gap: 10px; font-size: clamp(1.15rem, 2vw, 1.35rem); letter-spacing: -0.02em; }
.emi-panel__title .icon { width: 36px; height: 36px; padding: 8px; border-radius: 11px 4px 11px 4px; background: var(--gc-gradient); color: #fff; flex-shrink: 0; }
.emi-break { margin: 16px 0 0; display: grid; }
.emi-break > div { display: flex; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px dashed var(--gc-line); }
.emi-break dt { color: var(--gc-muted); font-weight: 600; }
.emi-break dd { margin: 0; font-weight: 800; color: var(--gc-ink); text-align: right; font-variant-numeric: tabular-nums; }
.emi-break .is-total { border-bottom: 0; margin-top: 6px; padding: 14px 16px; border-radius: 14px; background: var(--gc-tint); }
.emi-break .is-total dt { color: var(--gc-navy); font-weight: 800; }
.emi-break .is-total dd { color: var(--gc-navy); }

.emi-schedule__sub { margin-top: 4px; padding-left: 46px; font-size: 0.875rem; color: var(--gc-muted); font-weight: 600; }
.emi-table-wrap { margin-top: 16px; overflow-x: auto; }
.emi-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
.emi-table th { position: sticky; top: 0; z-index: 1; padding: 11px 14px; background: var(--gc-mist); color: var(--gc-muted); font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--gc-line-blue); }
.emi-table th:first-child, .emi-table td:first-child { text-align: left; }
.emi-table thead th:first-child { border-top-left-radius: 12px; }
.emi-table thead th:last-child { border-top-right-radius: 12px; }
.emi-table td { padding: 11px 14px; text-align: right; border-bottom: 1px solid var(--gc-line); color: var(--gc-text); white-space: nowrap; }
.emi-table td:first-child { font-weight: 800; color: var(--gc-navy); }
.emi-table tbody tr:hover td { background: #fbfdff; }
.emi-table tbody tr.is-last td { color: var(--gc-ink); font-weight: 700; }

/* year table → cards on small screens (no page overflow) */
@media (max-width: 639px) {
  .emi-table--years thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .emi-table--years, .emi-table--years tbody { display: block; }
  .emi-table--years tbody { display: grid; gap: 10px; }
  .emi-table--years tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; padding: 14px 16px; border-radius: 16px; background: var(--gc-mist); border: 1px solid var(--gc-line-blue); }
  .emi-table--years td { display: grid; padding: 0; border: 0; text-align: left; white-space: normal; font-weight: 800; color: var(--gc-ink); }
  .emi-table--years td::before { content: attr(data-label); font-size: 0.6875rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gc-muted); }
  .emi-table--years td:first-child { grid-column: 1 / -1; font-size: 1rem; }
  .emi-table--years td:first-child::before { display: none; }
  .emi-table--years tbody tr:hover td { background: none; }
}

.emi-monthly-btn { margin-top: 16px; }
.emi-monthly { margin-top: 14px; }
.emi-monthly[hidden] { display: none; }
.emi-scroll { max-height: 460px; overflow: auto; border: 1px solid var(--gc-line-blue); border-radius: 14px; overscroll-behavior: contain; }
.emi-scroll:focus-visible { outline: 3px solid rgba(2, 128, 231, 0.4); outline-offset: 2px; }
.emi-scroll .emi-table thead th { border-radius: 0; }
.emi-schedule__foot { margin-top: 10px; font-size: 0.8125rem; color: var(--gc-muted); }

/* ---------- Learn ---------- */
.emi-learn { background: linear-gradient(180deg, #fff 0%, var(--gc-mist) 100%); }
.emi-learn__grid { display: grid; gap: clamp(22px, 4vw, 48px); align-items: start; }
@media (min-width: 1024px) { .emi-learn__grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); } }
.emi-learn h2 { font-size: var(--fs-h2); margin-top: 6px; }
.emi-learn__lead { margin-top: 14px; color: var(--gc-text); font-size: 1.0625rem; line-height: 1.7; max-width: 62ch; }
.emi-formula { margin-top: 22px; padding: clamp(20px, 3vw, 28px); border-radius: 24px 8px 24px 8px; background: var(--gc-deep); color: #fff; box-shadow: var(--sh-lg); overflow: hidden; }
.emi-formula__eq { font-size: clamp(1.05rem, 2.6vw, 1.5rem); font-weight: 800; letter-spacing: 0.01em; overflow-wrap: anywhere; color: #fff; }
.emi-formula__eq sup { font-size: 0.6em; }
.emi-formula__keys { margin: 18px 0 0; display: grid; gap: 10px; }
.emi-formula__keys > div { display: flex; gap: 14px; align-items: center; }
.emi-formula__keys dt { display: grid; place-items: center; width: 38px; height: 38px; flex-shrink: 0; border-radius: 10px; background: rgba(23, 163, 243, 0.18); color: #7dd3fc; font-weight: 800; }
.emi-formula__keys dd { margin: 0; color: rgba(255, 255, 255, 0.82); }
.emi-formula__zero { margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, 0.12); font-size: 0.875rem; color: rgba(255, 255, 255, 0.7); }

.emi-example { padding: clamp(20px, 3vw, 28px); border-radius: 24px; background: #fff; border: 1px solid var(--gc-line-blue); box-shadow: var(--sh-md); min-width: 0; }
.emi-example h3 { margin-top: 12px; font-size: 1.2rem; }
.emi-example__steps { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; counter-reset: ex; }
.emi-example__steps li { display: flex; justify-content: space-between; gap: 12px; padding: 11px 14px; border-radius: 12px; background: var(--gc-mist); font-variant-numeric: tabular-nums; }
.emi-example__steps li span { color: var(--gc-muted); font-weight: 600; }
.emi-example__steps li b { color: var(--gc-ink); text-align: right; }
.emi-example__steps li:nth-child(3) { background: var(--gc-tint); }
.emi-example__steps li:nth-child(3) b { color: var(--gc-navy); font-size: 1.05rem; }
.emi-example__note { margin-top: 12px; font-size: 0.8125rem; color: var(--gc-muted); }

/* ---------- Factors ---------- */
.emi-factors { padding-top: clamp(24px, 4vw, 40px); }
.emi-factors .section-head { margin-bottom: clamp(20px, 3vw, 32px); }
.emi-factors__grid { display: grid; gap: 16px; }
@media (min-width: 720px) { .emi-factors__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.emi-factor { padding: 24px; border-radius: 24px; background: #fff; border: 1px solid var(--gc-line-blue); box-shadow: var(--sh-sm); transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
.emi-factor:hover { transform: translateY(-4px); box-shadow: var(--sh-md); }
.emi-factor__icon { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 16px 5px 16px 5px; background: var(--gc-gradient); color: #fff; box-shadow: var(--sh-blue); margin-bottom: 16px; }
.emi-factor__icon .icon { width: 23px; height: 23px; }
.emi-factor h3 { font-size: 1.125rem; }
.emi-factor p { margin-top: 8px; color: var(--gc-muted); line-height: 1.65; }

/* ---------- Disclaimer ---------- */
.emi-disclaimer-wrap { padding: clamp(8px, 2vw, 16px) 0 0; }
.emi-disclaimer { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; padding: clamp(18px, 3vw, 26px); border-radius: 22px; background: #fffbeb; border: 1px solid #fde68a; }
.emi-disclaimer__icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: #fef3c7; color: #b45309; }
.emi-disclaimer__icon .icon { width: 21px; height: 21px; }
.emi-disclaimer h2 { font-size: 1.125rem; color: #78350f; }
.emi-disclaimer p { margin-top: 8px; color: #44403c; line-height: 1.65; font-size: 0.9625rem; }
.emi-disclaimer a { color: #92400e; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 479px) { .emi-disclaimer { grid-template-columns: 1fr; } }

/* ---------- FAQ + CTA ---------- */
.emi-faq__grid { display: grid; gap: 28px; }
@media (min-width: 1024px) { .emi-faq__grid { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr); gap: 56px; align-items: start; } }
.emi-faq .section-head { margin-bottom: 0; }
.emi-faq .section-head .btn { margin-top: 20px; }
.emi-cta { padding-bottom: clamp(56px, 7vw, 96px); }

@media (prefers-reduced-motion: reduce) {
  .emi-in { animation: none; opacity: 1; transform: none; }
  .emi-results__emi.is-tick { animation: none; }
  .emi-donut__principal, .emi-donut__interest { transition: none; }
  .emi-factor:hover { transform: none; }
}
/* long CTA label must wrap on phones */
.emi-cta .cta-band > div { min-width: 0; }
@media (max-width: 559px) { .emi-cta .btn { white-space: normal; height: auto; min-height: var(--btn-h, 52px); padding-block: 12px; text-align: center; line-height: 1.3; } }
@media (max-width: 559px) { .emi-hero__chips { display: none; } }
