/* ============================================================
   TekproAI — sip.css  v2.0  [FLUID TYPOGRAPHY + RESPONSIVE]
   SIP / MF Calculator (sip-calculator.html)
   
   Typography: all use CSS custom properties with clamp()
   Minimum font size: 12px — never goes below
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Outfit:wght@300;400;500;600&family=DM+Mono:wght@300;400;500&display=swap');

/* ── Design Tokens ── */
:root {
  --bg:          #F8F9FA;
  --surface:     #FFFFFF;
  --surface2:    #F3F4F6;
  --green:       #00C853;
  --green-text:  #006B32;
  --green-dim:   rgba(0, 200, 83, 0.10);
  --green-mid:   rgba(0, 200, 83, 0.25);
  --gold:        #E67F00;
  --text:        #111827;
  --text2:       #374151;
  --muted:       #6B7280;
  --muted2:      #9CA3AF;
  --border:      #E5E7EB;
  --border-g:    rgba(0, 200, 83, 0.35);
  --wa:          #25D366;

  --f-display: 'Bebas Neue', sans-serif;
  --f-body:    'Outfit', sans-serif;
  --f-mono:    'DM Mono', monospace;

  /* ── FLUID TYPOGRAPHY — min 12px always ── */
  --fs-hero:    clamp(52px,  11vw,  100px);
  --fs-h1:      clamp(36px,  6vw,   62px);
  --fs-h2:      clamp(20px,  3vw,   24px);
  --fs-h3:      clamp(17px,  2.2vw, 21px);
  --fs-body:    clamp(14px,  1.5vw, 16px);
  --fs-label:   clamp(13px,  1.3vw, 14px);
  --fs-mono:    clamp(13px,  1.2vw, 14px);
  --fs-small:   clamp(12px,  1.1vw, 13px);
  --fs-badge:   12px;
  --fs-nav:     clamp(12px,  1.1vw, 13px);
  --fs-btn:     clamp(16px,  2vw,   20px);
  --fs-eyebrow: clamp(10px,  1vw,   12px);

  --r-sm:   8px;
  --r-md:   12px;
  --r-lg:   18px;
  --r-pill: 100px;
}

/* ── Reset + Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html  { height: 100%; scroll-behavior: smooth; }
body  {
  background: var(--bg); color: var(--text);
  font-family: var(--f-body); font-size: var(--fs-body);
  min-height: 100vh; overflow-x: hidden;
  line-height: 1.65; -webkit-font-smoothing: antialiased;
}

/* Backgrounds */
body::before {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.3;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.012'/%3E%3C/svg%3E");
}
body::after {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 200, 83, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 200, 83, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* ── Page wrapper ── */
.page { position: relative; z-index: 1; max-width: 780px; margin: 0 auto; padding: 0 clamp(12px, 3vw, 20px) 64px; }

/* ══════════════════════════════════════
   NAV
══════════════════════════════════════ */


/* ══════════════════════════════════════
   PAGE HEADER
══════════════════════════════════════ */
.page-header { text-align: center; margin-bottom: clamp(22px, 3.5vw, 30px); }
.eyebrow { font-family: var(--f-mono); font-size: var(--fs-eyebrow); color: var(--green-text); letter-spacing: 4px; text-transform: uppercase; margin-bottom: 10px; }
.eyebrow span { display: inline-block; width: 20px; height: 1px; background: var(--green); vertical-align: middle; margin: 0 8px; }
.page-title { font-family: var(--f-display); font-size: var(--fs-hero); line-height: 0.9; letter-spacing: 2px; color: var(--text); margin-bottom: 8px; }
.page-title .g { color: var(--green); }
.page-sub { font-family: var(--f-mono); font-size: var(--fs-small); color: var(--muted); letter-spacing: 0.5px; line-height: 1.6; }

/* ══════════════════════════════════════
   MODE TABS
══════════════════════════════════════ */
.tabs {
  display: flex; gap: 4px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 4px;
  margin-bottom: clamp(16px, 3vw, 24px);
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.tab {
  flex: 1; padding: clamp(8px, 1.5vw, 11px) 4px;
  font-family: var(--f-mono); font-size: var(--fs-small);
  letter-spacing: 0.5px; text-transform: uppercase;
  color: var(--muted); background: none; border: none;
  border-radius: var(--r-sm); cursor: pointer;
  transition: all 0.2s; text-align: center; white-space: nowrap;
  min-width: max-content; padding-left: 12px; padding-right: 12px;
}
.tab.on           { background: var(--green); color: #000; font-weight: 700; }
.tab:not(.on):hover { color: var(--text); background: var(--green-dim); }

/* ══════════════════════════════════════
   CARD
══════════════════════════════════════ */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: clamp(16px, 3vw, 22px);
  margin-bottom: 16px; position: relative; overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}
.card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 200, 83, 0.25), transparent);
}
.ctitle {
  font-family: var(--f-mono); font-size: var(--fs-small);
  color: var(--green-text); letter-spacing: 2.5px; text-transform: uppercase;
  margin-bottom: 16px; display: flex; align-items: center; gap: 8px;
}
.ctitle::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ══════════════════════════════════════
   FORM
══════════════════════════════════════ */
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(10px, 2vw, 15px); }
.fgroup { display: flex; flex-direction: column; gap: 5px; }
.flabel {
  font-family: var(--f-mono); font-size: var(--fs-badge);
  color: var(--muted); letter-spacing: 2px; text-transform: uppercase;
}
.flabel em { color: var(--green-text); font-style: normal; font-size: var(--fs-small); }
.iwrap { position: relative; }
.iwrap .unit {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font-family: var(--f-mono); font-size: var(--fs-small); color: var(--muted); pointer-events: none;
}
.finput {
  width: 100%; background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 11px 36px 11px 13px;
  color: var(--text); font-family: var(--f-mono); font-size: 16px; /* 16px: prevent iOS zoom */
  outline: none; transition: border-color 0.2s; -webkit-appearance: none;
}
.finput:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-dim); border-width: 1.5px; }
.finput::placeholder { color: var(--muted2); }
select.finput { padding-right: 13px; cursor: pointer; }

/* ── Range Sliders ── */
.rwrap { display: flex; flex-direction: column; gap: 6px; }
.rrow  { display: flex; align-items: center; gap: 10px; }
input[type=range] {
  flex: 1; -webkit-appearance: none; height: 3px;
  border-radius: 2px; background: var(--border); outline: none; cursor: pointer;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--green); cursor: pointer;
  border: 2px solid var(--bg); box-shadow: 0 0 0 3px var(--green-dim);
}
input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--green); border: none; }
.rval {
  font-family: var(--f-display); font-size: clamp(19px, 3vw, 22px);
  color: var(--green-text); min-width: 48px; text-align: right; line-height: 1;
}

/* ── Step-up toggle ── */
.trow {
  display: flex; align-items: center; justify-content: space-between;
  padding: clamp(10px, 2vw, 14px) clamp(12px, 2vw, 16px);
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--r-md); cursor: pointer; transition: border-color 0.2s;
  margin-top: 12px; gap: 12px;
}
.trow:hover { border-color: var(--border-g); }
.tlabel { font-family: var(--f-mono); font-size: var(--fs-small); color: var(--muted); letter-spacing: 0.3px; line-height: 1.5; }
.tlabel strong { color: var(--text); display: block; margin-bottom: 1px; font-size: var(--fs-label); }
.tswitch { width: 38px; height: 22px; background: var(--border); border-radius: 11px; position: relative; transition: background 0.2s; flex-shrink: 0; }
.tswitch::after { content: ''; position: absolute; width: 16px; height: 16px; background: #fff; border-radius: 50%; top: 3px; left: 3px; transition: transform 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.tswitch.on          { background: var(--green); }
.tswitch.on::after   { transform: translateX(16px); }
.stepfields          { display: none; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 12px; }
.stepfields.show     { display: grid; }

/* ── Goal Planner Callout ── */
.goal-callout {
  display: flex; align-items: flex-start; gap: 14px;
  background: linear-gradient(135deg, rgba(0, 200, 83, 0.09), rgba(0, 200, 83, 0.03));
  border: 1.5px solid rgba(0, 200, 83, 0.4); border-radius: var(--r-lg);
  padding: clamp(14px, 2.5vw, 20px); margin-bottom: 18px;
  animation: fadeUp 0.4s ease both;
}
.gc-icon { font-size: 26px; flex-shrink: 0; margin-top: 2px; }
.gc-headline { font-family: var(--f-body); font-size: var(--fs-h3); font-weight: 700; color: var(--text); line-height: 1.4; margin-bottom: 6px; }
.gc-headline span { color: var(--green-text); }
.gc-sub { font-family: var(--f-mono); font-size: var(--fs-small); color: var(--muted); line-height: 1.7; }
.gc-sub strong { color: var(--gold); font-weight: 600; }

/* ── Calculate button ── */
.cbtn {
  width: 100%; padding: clamp(12px, 2vw, 16px);
  background: var(--green); border: none; border-radius: var(--r-md);
  font-family: var(--f-display); font-size: var(--fs-btn);
  letter-spacing: 3px; color: #000; cursor: pointer;
  transition: all 0.2s; margin-top: 14px;
}
.cbtn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0, 200, 83, 0.28); }

/* ══════════════════════════════════════
   RESULTS
══════════════════════════════════════ */
.summary-bar  { display: flex; border-radius: 6px; overflow: hidden; height: 8px; margin-bottom: 20px; }
.bar-invested { background: var(--border); }
.bar-gains    { background: var(--green); }

.rgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.rcard {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: clamp(11px, 2vw, 14px) 12px;
  text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.rcard.hi { border-color: rgba(0, 200, 83, 0.35); background: rgba(0, 200, 83, 0.05); }
.rlabel {
  font-family: var(--f-mono); font-size: var(--fs-badge);
  color: var(--muted); letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 5px; display: block;
}
.rval   { font-family: var(--f-display); font-size: clamp(18px, 3vw, 25px); color: var(--text); line-height: 1; display: block; }
.rval.g  { color: var(--green-text); font-weight: 600; }
.rval.au { color: var(--gold); }
.rsub   { font-family: var(--f-mono); font-size: var(--fs-badge); color: var(--muted); margin-top: 3px; display: block; }

/* ── Stat pills ── */
.spills { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.spill  { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: clamp(8px, 1.5vw, 11px) 12px; }
.spill-l { font-family: var(--f-mono); font-size: var(--fs-badge); color: var(--muted); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 3px; display: block; }
.spill-v { font-family: var(--f-display); font-size: clamp(17px, 3vw, 21px); color: var(--green-text); line-height: 1; display: block; }

/* ── Chart ── */
.chart-wrap   { position: relative; height: clamp(200px, 30vw, 270px); margin-bottom: 6px; }
.chart-legend { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-top: 10px; padding: 0 4px; }
.legend-item  { display: flex; align-items: center; gap: 6px; font-family: var(--f-mono); font-size: var(--fs-small); color: var(--muted); }
.ldot         { width: 10px; height: 4px; border-radius: 2px; flex-shrink: 0; }

/* ── Compare cards ── */
.cgrid  { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ccard  { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--r-md); padding: clamp(12px, 2vw, 16px); }
.ccard.win { border-color: rgba(0, 200, 83, 0.45); background: rgba(0, 200, 83, 0.04); }
.chead  { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cname  { font-family: var(--f-display); font-size: var(--fs-h3); letter-spacing: 1px; color: var(--text); }
.cbadge { font-family: var(--f-mono); font-size: var(--fs-badge); color: #000; background: var(--green); padding: 3px 8px; border-radius: var(--r-pill); letter-spacing: 0.5px; font-weight: 600; }
.crow   { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px; }
.ckey   { color: var(--muted); font-family: var(--f-mono); font-size: var(--fs-small); }
.cval   { font-family: var(--f-display); font-size: clamp(15px, 2.5vw, 18px); color: var(--text); }
.cval.g { color: var(--green-text); }

/* ── Table ── */
.table-toggle {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-sm); cursor: pointer; transition: border-color 0.2s;
  font-family: var(--f-mono); font-size: var(--fs-small); color: var(--muted); letter-spacing: 0.5px;
}
.table-toggle:hover { border-color: var(--green); color: var(--text); }
.table-toggle .arrow { transition: transform 0.25s; font-size: 12px; }
.table-toggle.open .arrow { transform: rotate(180deg); }
.table-body-wrap { display: none; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-top: none; border-radius: 0 0 var(--r-sm) var(--r-sm); }
.table-body-wrap.show { display: block; }
table { width: 100%; border-collapse: collapse; font-family: var(--f-mono); font-size: var(--fs-small); }
thead { background: var(--surface2); }
th { padding: clamp(8px, 1.5vw, 10px) clamp(8px, 1.5vw, 11px); text-align: right; color: var(--muted); letter-spacing: 1px; font-size: var(--fs-badge); text-transform: uppercase; white-space: nowrap; font-weight: 500; }
th:first-child { text-align: left; }
td { padding: clamp(7px, 1.3vw, 9px) clamp(8px, 1.5vw, 11px); text-align: right; border-top: 1px solid var(--border); color: var(--text); font-size: var(--fs-small); }
td:first-child { text-align: left; color: var(--muted); }
tr:hover td { background: rgba(0, 200, 83, 0.025); }
tr.trow-total td { background: rgba(0, 200, 83, 0.07); color: var(--green-text); border-top: 2px solid rgba(0, 200, 83, 0.28); font-weight: 600; }

/* ── Share ── */
.share-section  { margin-bottom: 16px; }
.share-heading  { font-family: var(--f-body); font-size: var(--fs-h2); font-weight: 700; color: var(--text); margin-bottom: 14px; }
.share-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sbtn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: clamp(11px, 2vw, 14px) 16px;
  border-radius: var(--r-md); font-family: var(--f-body);
  font-size: var(--fs-label); font-weight: 600;
  cursor: pointer; border: none; transition: all 0.18s; width: 100%; white-space: nowrap;
}
.sbtn.wa { background: #25D366; color: #fff; }
.sbtn.wa:hover { background: #1ebe5d; transform: translateY(-1px); }
.sbtn.xt { background: #000; color: #fff; border: 1px solid #333; }
.sbtn.xt:hover { background: #111; transform: translateY(-1px); }
.sbtn.li { background: #0A66C2; color: #fff; }
.sbtn.li:hover { background: #0958a8; transform: translateY(-1px); }
.sbtn.cp { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.sbtn.cp:hover { border-color: var(--green); color: var(--green-text); transform: translateY(-1px); }
.copy-ok { background: var(--green-dim) !important; color: var(--green-text) !important; border-color: var(--green) !important; }

/* ── Feedback ── */
.feedback-sub  { font-family: var(--f-mono); font-size: var(--fs-small); color: var(--muted); margin-bottom: 16px; line-height: 1.6; }
.star-row      { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.star-label    { font-family: var(--f-mono); font-size: var(--fs-small); color: var(--muted); white-space: nowrap; }
.stars         { display: flex; gap: 6px; }
.star          { font-size: clamp(22px, 4vw, 27px); cursor: pointer; color: var(--border); transition: color 0.15s; line-height: 1; -webkit-tap-highlight-color: transparent; }
.star.lit      { color: var(--gold); }
.ftags         { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 14px; }
.ftag {
  font-family: var(--f-mono); font-size: var(--fs-small);
  padding: 6px 13px; border-radius: var(--r-pill);
  border: 1px solid var(--border); background: var(--surface2);
  color: var(--muted); cursor: pointer; transition: all 0.2s; -webkit-tap-highlight-color: transparent;
}
.ftag.on { border-color: var(--green); color: var(--green-text); background: var(--green-dim); }
.farea {
  width: 100%; background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 13px; color: var(--text);
  font-family: var(--f-body); font-size: 16px; /* 16px: prevent iOS zoom */
  outline: none; resize: vertical; min-height: 100px;
  transition: border-color 0.2s; margin-bottom: 10px; line-height: 1.6;
}
.farea:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-dim); }
.finput-sm {
  width: 100%; background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 11px 13px; color: var(--text);
  font-family: var(--f-body); font-size: 16px; outline: none;
  transition: border-color 0.2s; margin-bottom: 10px;
}
.finput-sm:focus { border-color: var(--green); }
.finput-sm::placeholder { color: var(--muted2); }
.fsub {
  width: 100%; padding: 14px; background: transparent;
  border: 1.5px solid var(--green); border-radius: var(--r-md);
  font-family: var(--f-body); font-size: var(--fs-btn); font-weight: 600;
  letter-spacing: 0.3px; color: var(--green-text); cursor: pointer;
  transition: all 0.2s; margin-top: 2px;
}
.fsub:hover { background: var(--green-dim); transform: translateY(-1px); }
.feedback-form { transition: opacity 0.2s; }
.fthanks {
  display: none; text-align: center; font-family: var(--f-mono);
  font-size: var(--fs-label); color: var(--green-text);
  padding: 24px 14px; background: var(--green-dim);
  border: 1px solid var(--green-mid); border-radius: var(--r-md); line-height: 1.7;
}
.fthanks .fthank-icon { font-size: 36px; display: block; margin-bottom: 10px; }
.fthanks strong { display: block; font-size: var(--fs-h3); margin-bottom: 6px; color: var(--text); }

/* ── Tips ── */
.tips { display: flex; flex-direction: column; gap: 8px; }
.tip  { display: flex; gap: 10px; align-items: flex-start; padding: clamp(10px, 1.8vw, 13px) 14px; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--r-md); }
.ti   { font-size: var(--fs-h3); flex-shrink: 0; margin-top: 2px; }
.tt   { font-family: var(--f-mono); font-size: var(--fs-small); color: var(--muted); line-height: 1.65; }
.tt strong { color: var(--text); }

/* ── Footer ── */
.page-footer, .pfoot { text-align: center; padding-top: 28px; border-top: 1px solid var(--border); margin-top: 28px; }
.page-footer a, .pfoot a { color: var(--green-text); text-decoration: none; }
.page-footer p, .pfoot p { font-family: var(--f-mono); font-size: var(--fs-small); color: var(--muted); line-height: 2; letter-spacing: 0.3px; }

/* ── Visibility helpers ── */
.hidden { display: none !important; }
.results-wrap { display: none; }
.results-wrap.show { display: block; }

/* ── Animations ── */
@keyframes fadeUp   { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes aiPulse  { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.anim { animation: fadeUp 0.4s ease both; }

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 600px) {
  .fgrid      { grid-template-columns: 1fr; }
  .rgrid      { grid-template-columns: 1fr 1fr; }
  .spills     { grid-template-columns: 1fr 1fr; }
  .cgrid      { grid-template-columns: 1fr; }
  .stepfields { grid-template-columns: 1fr; }
  .chart-wrap { height: 200px; }
  .share-row  { grid-template-columns: 1fr 1fr; }
  .nav-badge  { display: none; }
  .nav-link   { padding: 6px 10px; font-size: var(--fs-badge); }
  .tabs       { border-radius: var(--r-sm); }
}

@media (max-width: 400px) {
  .rgrid { grid-template-columns: 1fr; }
  .sbtn  { font-size: var(--fs-small); padding: 11px 8px; }
}
