/* ==========================================================================
   EMI Calculator — Apps Bean Technologies
   Palette taken directly from the app: teal-green primary on a mint grid-paper
   background, with the four tool accents from the home screen —
   SIP coral, DPS amber, FDR blue, DBR olive.
   ========================================================================== */

:root {
  --teal:       #167B6A;
  --teal-deep:  #0E4A40;
  --ink:        #0A1F1B;
  --ink-soft:   #56655F;
  --mint:       #E8FEF2;
  --mint-2:     #F2FBF6;
  --mint-panel: #DFF3EA;
  --paper:      #FFFFFF;
  --line:       #D6EAE0;
  --line-2:     #E4EFE9;

  --coral:      #E5654B;   --coral-soft: #FBE3DD;
  --amber:      #F2A93C;   --amber-soft: #FCEDD4;
  --blue:       #4C7BC4;   --blue-soft:  #E1EAF6;
  --olive:      #8A9A34;   --olive-soft: #EEF2DA;

  --radius:     18px;
  --shadow-sm:  0 1px 2px rgba(10,31,27,.05), 0 6px 18px rgba(10,31,27,.05);
  --shadow-md:  0 12px 32px rgba(10,31,27,.10);
  --shadow-lg:  0 24px 60px rgba(10,31,27,.16);
}

* { -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  background-color: var(--mint);
  background-image:
    linear-gradient(rgba(22,123,106,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22,123,106,.055) 1px, transparent 1px);
  background-size: 34px 34px;
}

.display { font-family: 'Sora','Inter',sans-serif; font-weight: 700; letter-spacing: -0.032em; line-height: 1.08; }
.figure { font-family: 'IBM Plex Mono',ui-monospace,SFMono-Regular,Menlo,monospace; font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; }
.eyebrow { font-family: 'IBM Plex Mono',monospace; font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 600; }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-teal  { background: var(--mint-panel); border: 1px solid rgba(22,123,106,.20); border-radius: var(--radius); }
.card-coral { background: var(--coral-soft); border: 1px solid rgba(229,101,75,.24); border-radius: var(--radius); }
.card-amber { background: var(--amber-soft); border: 1px solid rgba(242,169,60,.28); border-radius: var(--radius); }
.card-blue  { background: var(--blue-soft);  border: 1px solid rgba(76,123,196,.24); border-radius: var(--radius); }
.card-olive { background: var(--olive-soft); border: 1px solid rgba(138,154,52,.26); border-radius: var(--radius); }
.card-ink   { background: var(--ink); color: #fff; border-radius: var(--radius); }

.rule-coral { border-top: 3px solid var(--coral); }
.rule-amber { border-top: 3px solid var(--amber); }
.rule-blue  { border-top: 3px solid var(--blue); }
.rule-olive { border-top: 3px solid var(--olive); }
.rule-teal  { border-top: 3px solid var(--teal); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .6rem; font-weight: 600; border-radius: 12px; padding: .85rem 1.5rem; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; border: 1px solid transparent; text-decoration: none; cursor: pointer; font-size: .97rem; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--teal); color: #fff; box-shadow: var(--shadow-md); }
.btn-primary:hover { background: var(--teal-deep); }
.btn-ink { background: var(--ink); color: #fff; box-shadow: var(--shadow-md); }
.btn-ink:hover { background: #05130F; }
.btn-ghost { background: var(--paper); color: var(--teal-deep); border-color: var(--line); }
.btn-ghost:hover { background: #fff; border-color: var(--teal); }
.btn-light { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.26); }
.btn-light:hover { background: rgba(255,255,255,.22); }

a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; border-radius: 8px; }

.site-header { position: sticky; top: 0; z-index: 50; background: rgba(232,254,242,.86); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.nav-link { position: relative; font-weight: 500; color: var(--ink-soft); padding: .4rem 0; text-decoration: none; transition: color .18s ease; }
.nav-link:hover { color: var(--teal-deep); }
.nav-link.is-active { color: var(--teal-deep); font-weight: 600; }
.nav-link.is-active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 3px; border-radius: 3px; background: var(--teal); }
#mobileNav { max-height: 0; overflow: hidden; transition: max-height .32s ease; }
#mobileNav.open { max-height: 460px; }

.field-label { font-size: .82rem; font-weight: 600; color: var(--ink-soft); margin-bottom: .4rem; display: block; }
.amount-input { width: 100%; border: 1px solid var(--line); border-radius: 12px; background: var(--mint-2); padding: .75rem 1rem .75rem 2.4rem; font-family: 'IBM Plex Mono',monospace; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 1.02rem; color: var(--ink); }
.amount-input:focus { background: #fff; border-color: var(--teal); }
.amount-wrap { position: relative; }
.amount-prefix { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--ink-soft); font-weight: 600; pointer-events: none; font-size: 1rem; }

input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 99px; background: var(--line); outline-offset: 6px; margin: .55rem 0 0; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--teal); border: 4px solid #fff; box-shadow: 0 2px 8px rgba(22,123,106,.4); cursor: pointer; }
input[type=range]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--teal); border: 4px solid #fff; box-shadow: 0 2px 8px rgba(22,123,106,.4); cursor: pointer; }

.seg { display: inline-flex; background: var(--line-2); border-radius: 11px; padding: 4px; gap: 4px; }
.seg button { border: 0; background: transparent; padding: .5rem 1rem; border-radius: 8px; font-size: .85rem; font-weight: 600; color: var(--ink-soft); cursor: pointer; transition: all .16s ease; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--teal-deep); box-shadow: 0 1px 3px rgba(10,31,27,.12); }

.splitbar { display: flex; height: 46px; border-radius: 11px; overflow: hidden; background: var(--line); box-shadow: inset 0 0 0 1px rgba(10,31,27,.05); }
.splitbar span { display: grid; place-items: center; font-size: .74rem; font-weight: 700; color: #fff; transition: width .45s cubic-bezier(.4,0,.2,1); overflow: hidden; white-space: nowrap; }
.split-principal { background: var(--teal); }
.split-interest  { background: var(--amber); }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.result-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .7rem 0; }
.result-row + .result-row { border-top: 1px dashed var(--line); }
.result-label { color: var(--ink-soft); font-size: .9rem; }
.result-value { font-family: 'IBM Plex Mono',monospace; font-variant-numeric: tabular-nums; font-weight: 700; }

.feature-card { transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease; }
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--teal); }
.icon-chip { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; font-size: 1.2rem; }
.chip-teal  { background: var(--mint-panel); color: var(--teal); }
.chip-coral { background: var(--coral-soft); color: var(--coral); }
.chip-amber { background: var(--amber-soft); color: #C77E14; }
.chip-blue  { background: var(--blue-soft);  color: var(--blue); }
.chip-olive { background: var(--olive-soft); color: #6F7C24; }

.phone { border-radius: 30px; border: 7px solid var(--ink); background: var(--ink); box-shadow: var(--shadow-lg); overflow: hidden; display: block; }
.phone img { display: block; width: 100%; border-radius: 23px; }
.shot-rail { scrollbar-width: thin; scrollbar-color: var(--teal) transparent; }
.shot-rail::-webkit-scrollbar { height: 8px; }
.shot-rail::-webkit-scrollbar-thumb { background: rgba(22,123,106,.3); border-radius: 99px; }

.faq-item { border-bottom: 1px solid var(--line); }
.faq-q { width: 100%; display: flex; gap: 1rem; align-items: flex-start; justify-content: space-between; padding: 1.15rem 0; text-align: left; font-weight: 600; color: var(--ink); background: none; border: 0; cursor: pointer; font-size: 1.01rem; }
.faq-q:hover { color: var(--teal-deep); }
.faq-icon { flex: 0 0 auto; color: var(--teal); transition: transform .25s ease; margin-top: .2rem; }
.faq-q[aria-expanded="true"] .faq-icon { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.faq-a > div { padding: 0 0 1.15rem; color: var(--ink-soft); line-height: 1.75; }

.legal h2 { font-family: 'Sora',sans-serif; font-size: 1.38rem; font-weight: 700; color: var(--teal-deep); margin: 2.4rem 0 .7rem; letter-spacing: -.02em; }
.legal h3 { font-weight: 700; font-size: 1.02rem; margin: 1.5rem 0 .45rem; color: var(--ink); }
.legal p  { color: var(--ink-soft); line-height: 1.8; margin-bottom: .9rem; }
.legal ul { list-style: none; margin: 0 0 1.1rem; padding: 0; }
.legal li { color: var(--ink-soft); line-height: 1.75; padding-left: 1.55rem; position: relative; margin-bottom: .5rem; }
.legal li::before { content: '\f00c'; font-family: 'Font Awesome 6 Free'; font-weight: 900; position: absolute; left: 0; top: .18rem; color: var(--teal); font-size: .78rem; }
.legal a { color: var(--teal); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.legal table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.legal table th, .legal table td { border: 1px solid var(--line); padding: .8rem; text-align: left; vertical-align: top; }
.legal table th { background: var(--mint-2); color: var(--teal-deep); font-weight: 700; }
.legal table td { color: var(--ink-soft); }

.toc a { display: block; padding: .4rem 0 .4rem .8rem; color: var(--ink-soft); font-size: .88rem; text-decoration: none; border-left: 2px solid transparent; transition: all .18s ease; }
.toc a:hover { color: var(--teal-deep); border-left-color: var(--teal); }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
}
