Compare commits
2 Commits
1563a183fb
...
b658f50c9c
| Author | SHA1 | Date | |
|---|---|---|---|
| b658f50c9c | |||
| ba9ddee99d |
219
AI_SETUP.md
Normal file
219
AI_SETUP.md
Normal file
@@ -0,0 +1,219 @@
|
||||
# HOA LedgerIQ — AI API Configuration Guide
|
||||
|
||||
## Overview
|
||||
|
||||
The **Benefit Calculator widget** currently runs entirely client-side using conservative
|
||||
fixed-rate math. This guide explains how to upgrade it to call a real AI API
|
||||
(Claude or OpenAI) so the recommendation text is generated dynamically by a language model.
|
||||
|
||||
---
|
||||
|
||||
## Architecture
|
||||
|
||||
```
|
||||
Browser (app.js)
|
||||
└─► POST /api/calculate (server.js)
|
||||
└─► Anthropic / OpenAI API
|
||||
└─► Returns AI-generated investment recommendation text
|
||||
└─► JSON response back to browser
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Step 1 — Add your API key to `.env`
|
||||
|
||||
Open `.env` in the project root and add one of the following:
|
||||
|
||||
```env
|
||||
# For Claude (Anthropic) — recommended
|
||||
ANTHROPIC_API_KEY=sk-ant-...
|
||||
|
||||
# OR for OpenAI
|
||||
OPENAI_API_KEY=sk-...
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Step 2 — Install the SDK
|
||||
|
||||
```bash
|
||||
# Claude (Anthropic)
|
||||
npm install @anthropic-ai/sdk
|
||||
|
||||
# OR OpenAI
|
||||
npm install openai
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Step 3 — Add the `/api/calculate` endpoint to `server.js`
|
||||
|
||||
Add this block after the existing `/api/health` route:
|
||||
|
||||
### Using Claude (Anthropic)
|
||||
|
||||
```js
|
||||
const Anthropic = require('@anthropic-ai/sdk');
|
||||
const anthropic = new Anthropic({ apiKey: process.env.ANTHROPIC_API_KEY });
|
||||
|
||||
app.post('/api/calculate', async (req, res) => {
|
||||
const { homesites, propertyType, annualIncome, paymentFreq, reserveFunds, interest2025 } = req.body ?? {};
|
||||
|
||||
if (!homesites || !annualIncome) {
|
||||
return res.status(400).json({ error: 'homesites and annualIncome are required.' });
|
||||
}
|
||||
|
||||
const fmt = n => '$' + Math.round(n).toLocaleString();
|
||||
const freqLabel = { monthly: 'monthly', quarterly: 'quarterly', annually: 'annual' }[paymentFreq] || 'monthly';
|
||||
const typeLabel = { sfh: 'single-family home', townhomes: 'townhome', condos: 'condo', mixed: 'mixed-use' }[propertyType] || '';
|
||||
|
||||
const prompt = `You are a conservative HOA financial advisor. Given the following community data, provide a brief (3-4 sentence) plain-English investment income recommendation. Use only conservative, realistic estimates. Do not speculate beyond what the data supports.
|
||||
|
||||
Community: ${homesites}-unit ${typeLabel} association
|
||||
Annual dues income: ${fmt(annualIncome)} (collected ${freqLabel})
|
||||
Reserve fund balance: ${fmt(reserveFunds || 0)}
|
||||
Interest income earned in 2025: ${fmt(interest2025 || 0)}
|
||||
|
||||
Provide a recommendation focused on:
|
||||
1. How much of the reserve funds could conservatively be invested and in what vehicle (e.g. CD ladder, money market, T-bills)
|
||||
2. How much operating cash could earn interest between collection and expense periods
|
||||
3. A realistic estimated annual interest income potential
|
||||
4. A single sentence comparing that to their 2025 actual if provided
|
||||
|
||||
Keep the tone professional and factual. No bullet points — flowing paragraph only.`;
|
||||
|
||||
try {
|
||||
const message = await anthropic.messages.create({
|
||||
model: 'claude-opus-4-6',
|
||||
max_tokens: 300,
|
||||
messages: [{ role: 'user', content: prompt }],
|
||||
});
|
||||
|
||||
const text = message.content[0]?.text ?? '';
|
||||
res.json({ recommendation: text });
|
||||
} catch (err) {
|
||||
console.error('AI API error:', err.message);
|
||||
res.status(502).json({ error: 'AI service unavailable. Showing estimated result.' });
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
### Using OpenAI (GPT-4o)
|
||||
|
||||
```js
|
||||
const OpenAI = require('openai');
|
||||
const openai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });
|
||||
|
||||
app.post('/api/calculate', async (req, res) => {
|
||||
const { homesites, propertyType, annualIncome, paymentFreq, reserveFunds, interest2025 } = req.body ?? {};
|
||||
|
||||
// ... (same prompt construction as above) ...
|
||||
|
||||
try {
|
||||
const completion = await openai.chat.completions.create({
|
||||
model: 'gpt-4o',
|
||||
max_tokens: 300,
|
||||
messages: [{ role: 'user', content: prompt }],
|
||||
});
|
||||
|
||||
const text = completion.choices[0]?.message?.content ?? '';
|
||||
res.json({ recommendation: text });
|
||||
} catch (err) {
|
||||
console.error('AI API error:', err.message);
|
||||
res.status(502).json({ error: 'AI service unavailable.' });
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Step 4 — Update `app.js` to call the API endpoint
|
||||
|
||||
In the `initCalculator` function, replace this line in the submitBtn handler:
|
||||
|
||||
```js
|
||||
document.getElementById('calcAiText').textContent = ai; // current: client-side text
|
||||
```
|
||||
|
||||
With this:
|
||||
|
||||
```js
|
||||
// Call the AI endpoint; fall back to client-side text if unavailable
|
||||
try {
|
||||
const aiRes = await fetch('/api/calculate', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ homesites, propertyType, annualIncome, paymentFreq, reserveFunds, interest2025 }),
|
||||
});
|
||||
if (aiRes.ok) {
|
||||
const { recommendation } = await aiRes.json();
|
||||
document.getElementById('calcAiText').textContent = recommendation;
|
||||
} else {
|
||||
document.getElementById('calcAiText').textContent = ai; // fallback
|
||||
}
|
||||
} catch (_) {
|
||||
document.getElementById('calcAiText').textContent = ai; // fallback
|
||||
}
|
||||
```
|
||||
|
||||
> Note: The `submitBtn` handler must be declared `async` for the `await` above to work:
|
||||
> ```js
|
||||
> submitBtn?.addEventListener('click', async () => { ... });
|
||||
> ```
|
||||
|
||||
---
|
||||
|
||||
## Step 5 — Restart the server
|
||||
|
||||
```bash
|
||||
sudo systemctl restart hoaledgeriqweb
|
||||
|
||||
# Verify the endpoint is live
|
||||
curl -X POST http://localhost:3000/api/calculate \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"homesites":150,"propertyType":"sfh","annualIncome":300000,"paymentFreq":"monthly","reserveFunds":500000,"interest2025":4200}'
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Prompt Tuning Tips
|
||||
|
||||
The prompt in Step 3 is the core of the AI's behavior. You can adjust it to:
|
||||
|
||||
| Goal | Change |
|
||||
|---|---|
|
||||
| More optimistic estimates | Change "conservative" to "moderate" in the prompt |
|
||||
| Shorter output | Reduce `max_tokens` to `150` |
|
||||
| Include specific investment products | Add "mention specific products like Vanguard Federal Money Market or 6-month T-bills" |
|
||||
| Add a disclaimer | Append "End with one sentence reminding them this is not financial advice." |
|
||||
|
||||
---
|
||||
|
||||
## Cost Estimate
|
||||
|
||||
| Model | Approx. cost per calculator use |
|
||||
|---|---|
|
||||
| Claude Opus 4.6 | ~$0.002 |
|
||||
| Claude Sonnet 4.6 | ~$0.0004 |
|
||||
| GPT-4o | ~$0.002 |
|
||||
| GPT-4o-mini | ~$0.00005 |
|
||||
|
||||
For a landing page with low traffic, even Claude Opus is negligible cost. For scale,
|
||||
`claude-sonnet-4-6` is the best balance of quality and price.
|
||||
|
||||
---
|
||||
|
||||
## Security Notes
|
||||
|
||||
- **Never expose your API key in `app.js` or any client-side code.** All AI calls must go through `server.js`.
|
||||
- Rate-limit the `/api/calculate` endpoint to prevent abuse (e.g. with `express-rate-limit`):
|
||||
|
||||
```bash
|
||||
npm install express-rate-limit
|
||||
```
|
||||
|
||||
```js
|
||||
const rateLimit = require('express-rate-limit');
|
||||
const calcLimiter = rateLimit({ windowMs: 60 * 1000, max: 10 }); // 10 req/min per IP
|
||||
app.use('/api/calculate', calcLimiter);
|
||||
```
|
||||
118
app.js
118
app.js
@@ -20,6 +20,124 @@
|
||||
if (signupEl) signupEl.textContent = text;
|
||||
})();
|
||||
|
||||
// ── Benefit Calculator ───────────────────────────────────
|
||||
(function initCalculator() {
|
||||
const overlay = document.getElementById('calcOverlay');
|
||||
const openBtn = document.getElementById('openCalc');
|
||||
const closeBtn = document.getElementById('calcClose');
|
||||
const submitBtn = document.getElementById('calcSubmit');
|
||||
const recalcBtn = document.getElementById('calcRecalc');
|
||||
const calcForm = document.getElementById('calcForm');
|
||||
const calcRes = document.getElementById('calcResults');
|
||||
const calcErr = document.getElementById('calcError');
|
||||
const ctaBtn = document.getElementById('calcCTABtn');
|
||||
|
||||
if (!overlay) return;
|
||||
|
||||
function open() { overlay.classList.add('open'); document.body.style.overflow = 'hidden'; }
|
||||
function close() { overlay.classList.remove('open'); document.body.style.overflow = ''; }
|
||||
|
||||
openBtn?.addEventListener('click', open);
|
||||
closeBtn?.addEventListener('click', close);
|
||||
overlay.addEventListener('click', e => { if (e.target === overlay) close(); });
|
||||
document.addEventListener('keydown', e => { if (e.key === 'Escape') close(); });
|
||||
|
||||
recalcBtn?.addEventListener('click', () => {
|
||||
calcRes.classList.add('hidden');
|
||||
calcForm.classList.remove('hidden');
|
||||
});
|
||||
|
||||
// Close modal and scroll to signup when CTA clicked
|
||||
ctaBtn?.addEventListener('click', () => {
|
||||
close();
|
||||
});
|
||||
|
||||
submitBtn?.addEventListener('click', () => {
|
||||
const homesites = parseFloat(document.getElementById('calcHomesites').value) || 0;
|
||||
const propertyType = document.getElementById('calcPropertyType').value;
|
||||
const annualIncome = parseFloat(document.getElementById('calcAnnualIncome').value) || 0;
|
||||
const paymentFreq = document.getElementById('calcPaymentFreq').value;
|
||||
const reserveFunds = parseFloat(document.getElementById('calcReserveFunds').value) || 0;
|
||||
const interest2025 = parseFloat(document.getElementById('calcInterest2025').value) || 0;
|
||||
|
||||
if (!homesites || !annualIncome) {
|
||||
calcErr.classList.remove('hidden');
|
||||
return;
|
||||
}
|
||||
calcErr.classList.add('hidden');
|
||||
|
||||
// ── Conservative investment assumptions ──
|
||||
// Operating cash: depending on payment frequency, portion investable in high-yield savings
|
||||
const opMultiplier = { monthly: 0.10, quarterly: 0.20, annually: 0.35 }[paymentFreq] || 0.10;
|
||||
const opRate = 0.040; // 4.0% money market / HYSA
|
||||
const resRatio = 0.65; // 65% of reserves investable (keep 35% liquid)
|
||||
const resRate = 0.0425; // 4.25% CD ladder / short-term treasuries
|
||||
|
||||
const investableOp = annualIncome * opMultiplier;
|
||||
const investableRes = reserveFunds * resRatio;
|
||||
const opInterest = Math.round(investableOp * opRate);
|
||||
const resInterest = Math.round(investableRes * resRate);
|
||||
const totalPotential = opInterest + resInterest;
|
||||
const increase = totalPotential - interest2025;
|
||||
const pctIncrease = interest2025 > 0
|
||||
? Math.round((increase / interest2025) * 100)
|
||||
: (totalPotential > 0 ? 100 : 0);
|
||||
|
||||
// ── Populate results ──
|
||||
const fmt = n => '$' + Math.round(n).toLocaleString();
|
||||
|
||||
document.getElementById('resultAmount').textContent = fmt(totalPotential);
|
||||
document.getElementById('resultCurrent').textContent = fmt(interest2025);
|
||||
document.getElementById('resultOperating').textContent = fmt(opInterest);
|
||||
document.getElementById('resultReserve').textContent = fmt(resInterest);
|
||||
|
||||
const badge = document.getElementById('resultBadge');
|
||||
if (increase > 0) {
|
||||
badge.textContent = `+${fmt(increase)} · +${pctIncrease}%`;
|
||||
badge.style.display = 'inline-block';
|
||||
} else {
|
||||
badge.style.display = 'none';
|
||||
}
|
||||
|
||||
// ── AI-style suggestion text ──
|
||||
const typeLabels = { sfh:'single-family home', townhomes:'townhome', condos:'condo', mixed:'mixed-use', '':'' };
|
||||
const typeLabel = typeLabels[propertyType] || '';
|
||||
const freqLabel = { monthly:'monthly', quarterly:'quarterly', annually:'annual' }[paymentFreq];
|
||||
const communityDesc = [homesites && `${homesites}-unit`, typeLabel, 'community'].filter(Boolean).join(' ');
|
||||
|
||||
let ai = `Based on your ${communityDesc} collecting ${fmt(annualIncome)} in ${freqLabel} dues`;
|
||||
if (reserveFunds > 0) ai += ` and ${fmt(reserveFunds)} in reserve funds`;
|
||||
ai += `, a conservative investment strategy could generate approximately ${fmt(totalPotential)} in annual interest income. `;
|
||||
if (resInterest > 0) ai += `Deploying ${fmt(investableRes)} of your reserve funds into a short-term CD ladder at ~4.25% yields ${fmt(resInterest)} annually. `;
|
||||
if (opInterest > 0) ai += `Keeping a ${fmt(investableOp)} operating cash buffer in a high-yield money market at ~4.0% adds another ${fmt(opInterest)}. `;
|
||||
if (interest2025 > 0 && increase > 0) {
|
||||
ai += `That's a ${fmt(increase)} improvement (+${pctIncrease}%) over your 2025 interest income of ${fmt(interest2025)} — with no additional risk.`;
|
||||
} else if (interest2025 === 0) {
|
||||
ai += `This would represent entirely new interest income for your community at no additional risk.`;
|
||||
}
|
||||
|
||||
document.getElementById('calcAiText').textContent = ai;
|
||||
|
||||
// ── Animate the main number ──
|
||||
animateValue(document.getElementById('resultAmount'), 0, totalPotential);
|
||||
|
||||
calcForm.classList.add('hidden');
|
||||
calcRes.classList.remove('hidden');
|
||||
});
|
||||
|
||||
function animateValue(el, from, to) {
|
||||
const duration = 900;
|
||||
const start = performance.now();
|
||||
function step(now) {
|
||||
const progress = Math.min((now - start) / duration, 1);
|
||||
const ease = 1 - Math.pow(1 - progress, 3);
|
||||
el.textContent = '$' + Math.round(from + (to - from) * ease).toLocaleString();
|
||||
if (progress < 1) requestAnimationFrame(step);
|
||||
}
|
||||
requestAnimationFrame(step);
|
||||
}
|
||||
})();
|
||||
|
||||
// ── Screenshot Carousel ──────────────────────────────────
|
||||
(function initCarousel() {
|
||||
const carousel = document.getElementById('screenshotCarousel');
|
||||
|
||||
118
index.html
118
index.html
@@ -63,6 +63,7 @@
|
||||
</p>
|
||||
<div class="hero-actions">
|
||||
<a href="#preview-signup" class="btn btn-primary btn-lg">Join the Preview List</a>
|
||||
<button class="btn btn-calc btn-lg" id="openCalc">✦ Calculate Your Interest Income Potential</button>
|
||||
<a href="#features" class="btn btn-ghost btn-lg">See What's Inside ↓</a>
|
||||
</div>
|
||||
<div class="hero-trust">
|
||||
@@ -428,6 +429,123 @@
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<!-- ── BENEFIT CALCULATOR MODAL ─────────────────────── -->
|
||||
<div class="calc-overlay" id="calcOverlay" aria-modal="true" role="dialog">
|
||||
<div class="calc-modal">
|
||||
<button class="calc-close" id="calcClose" aria-label="Close calculator">×</button>
|
||||
|
||||
<div class="calc-header">
|
||||
<div class="section-label">ROI Calculator</div>
|
||||
<h2>See What LedgerIQ Could Earn Your Community</h2>
|
||||
<p>Answer a few quick questions for a personalized, conservative interest income estimate.</p>
|
||||
</div>
|
||||
|
||||
<!-- INPUTS -->
|
||||
<div id="calcForm">
|
||||
<div class="calc-grid">
|
||||
<div class="calc-field">
|
||||
<label for="calcHomesites">Number of Homesites</label>
|
||||
<input type="number" id="calcHomesites" placeholder="e.g. 150" min="1" />
|
||||
</div>
|
||||
<div class="calc-field">
|
||||
<label for="calcPropertyType">Property Type</label>
|
||||
<select id="calcPropertyType">
|
||||
<option value="">Select type...</option>
|
||||
<option value="sfh">Single Family Homes</option>
|
||||
<option value="townhomes">Townhomes</option>
|
||||
<option value="condos">Condos</option>
|
||||
<option value="mixed">Mixed Use</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="calc-field">
|
||||
<label for="calcAnnualIncome">Annual Dues Income</label>
|
||||
<div class="input-prefix-wrap">
|
||||
<span class="input-prefix">$</span>
|
||||
<input type="number" id="calcAnnualIncome" placeholder="e.g. 250,000" min="0" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="calc-field">
|
||||
<label for="calcPaymentFreq">Dues Payment Frequency</label>
|
||||
<select id="calcPaymentFreq">
|
||||
<option value="monthly">Monthly</option>
|
||||
<option value="quarterly">Quarterly</option>
|
||||
<option value="annually">Annually</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="calc-field">
|
||||
<label for="calcReserveFunds">Current Reserve Fund Balance</label>
|
||||
<div class="input-prefix-wrap">
|
||||
<span class="input-prefix">$</span>
|
||||
<input type="number" id="calcReserveFunds" placeholder="e.g. 500,000" min="0" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="calc-field">
|
||||
<label for="calcInterest2025">Interest Income Earned in 2025</label>
|
||||
<div class="input-prefix-wrap">
|
||||
<span class="input-prefix">$</span>
|
||||
<input type="number" id="calcInterest2025" placeholder="e.g. 4,500" min="0" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p class="calc-error hidden" id="calcError">Please fill in homesites and annual dues income to continue.</p>
|
||||
<button class="btn btn-primary btn-lg calc-submit-btn" id="calcSubmit">Calculate My Potential →</button>
|
||||
<p class="calc-fine">Conservative estimates for illustrative purposes only. Not financial advice.</p>
|
||||
</div>
|
||||
|
||||
<!-- RESULTS -->
|
||||
<div id="calcResults" class="hidden">
|
||||
<div class="result-highlight">
|
||||
<div class="result-label">Estimated Annual Interest Income Potential</div>
|
||||
<div class="result-amount" id="resultAmount">$0</div>
|
||||
<div class="result-comparison">
|
||||
<span>vs. your 2025 earnings: <strong id="resultCurrent">$0</strong></span>
|
||||
<span class="result-badge" id="resultBadge"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="result-breakdown">
|
||||
<div class="result-row">
|
||||
<span>Operating fund cash management</span>
|
||||
<span class="result-row-val" id="resultOperating">$0</span>
|
||||
</div>
|
||||
<div class="result-row">
|
||||
<span>Reserve fund investment income</span>
|
||||
<span class="result-row-val" id="resultReserve">$0</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="calc-ai-bubble">
|
||||
<span class="ai-label">✦ LedgerIQ AI Estimate</span>
|
||||
<p id="calcAiText"></p>
|
||||
</div>
|
||||
|
||||
<div class="calc-cta">
|
||||
<p>Ready to put these gains to work for your community?</p>
|
||||
<a href="#preview-signup" class="btn btn-primary btn-lg calc-cta-btn" id="calcCTABtn">Get Early Access — Reserve My Spot →</a>
|
||||
<button class="btn btn-ghost calc-recalc" id="calcRecalc">← Recalculate</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="app.js"></script>
|
||||
|
||||
<!-- Support Chat Widget -->
|
||||
<script>
|
||||
(function(d,t) {
|
||||
var BASE_URL="https://chat.hoaledgeriq.com";
|
||||
var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
|
||||
g.src=BASE_URL+"/packs/js/sdk.js";
|
||||
g.async = true;
|
||||
s.parentNode.insertBefore(g,s);
|
||||
g.onload=function(){
|
||||
window.chatwootSDK.run({
|
||||
websiteToken: '1QMW1fycL5xHvd6XMfg4Dbb4',
|
||||
baseUrl: BASE_URL
|
||||
})
|
||||
}
|
||||
})(document,"script");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
217
styles.css
217
styles.css
@@ -623,6 +623,223 @@ body {
|
||||
color: var(--gray-700);
|
||||
}
|
||||
|
||||
/* ---- Calculator CTA button ---- */
|
||||
.btn-calc {
|
||||
background: linear-gradient(135deg, rgba(79,70,229,0.25), rgba(14,165,233,0.2));
|
||||
border: 1.5px solid rgba(99,102,241,0.6);
|
||||
color: #c7d2fe;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
.btn-calc::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: linear-gradient(135deg, rgba(79,70,229,0.4), rgba(14,165,233,0.3));
|
||||
opacity: 0;
|
||||
transition: opacity 0.2s;
|
||||
}
|
||||
.btn-calc:hover { color: #fff; border-color: rgba(99,102,241,0.9); transform: translateY(-1px); box-shadow: 0 8px 28px rgba(79,70,229,0.3); }
|
||||
.btn-calc:hover::before { opacity: 1; }
|
||||
.btn-calc span, .btn-calc { position: relative; z-index: 1; }
|
||||
|
||||
/* ---- Calculator Modal ---- */
|
||||
.calc-overlay {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
background: rgba(0,0,0,0.75);
|
||||
backdrop-filter: blur(6px);
|
||||
z-index: 1000;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 24px;
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
transition: opacity 0.25s ease;
|
||||
}
|
||||
.calc-overlay.open {
|
||||
opacity: 1;
|
||||
pointer-events: all;
|
||||
}
|
||||
.calc-modal {
|
||||
background: var(--gray-800);
|
||||
border: 1px solid rgba(99,102,241,0.35);
|
||||
border-radius: var(--radius-lg);
|
||||
padding: 44px 48px;
|
||||
max-width: 700px;
|
||||
width: 100%;
|
||||
max-height: 90vh;
|
||||
overflow-y: auto;
|
||||
position: relative;
|
||||
box-shadow: 0 0 80px rgba(79,70,229,0.25), var(--shadow-lg);
|
||||
transform: translateY(16px);
|
||||
transition: transform 0.25s ease;
|
||||
}
|
||||
.calc-overlay.open .calc-modal { transform: translateY(0); }
|
||||
.calc-close {
|
||||
position: absolute;
|
||||
top: 16px; right: 20px;
|
||||
background: none;
|
||||
border: none;
|
||||
color: var(--gray-500);
|
||||
font-size: 26px;
|
||||
cursor: pointer;
|
||||
line-height: 1;
|
||||
padding: 4px 8px;
|
||||
border-radius: 6px;
|
||||
transition: color 0.15s, background 0.15s;
|
||||
}
|
||||
.calc-close:hover { color: #fff; background: rgba(255,255,255,0.08); }
|
||||
.calc-header { margin-bottom: 28px; }
|
||||
.calc-header h2 { font-size: 26px; font-weight: 800; color: #fff; letter-spacing: -0.02em; margin-bottom: 8px; }
|
||||
.calc-header p { font-size: 15px; color: var(--gray-400); }
|
||||
.calc-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 16px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.calc-field { display: flex; flex-direction: column; gap: 6px; }
|
||||
.calc-field label { font-size: 13px; font-weight: 600; color: var(--gray-400); }
|
||||
.calc-field input,
|
||||
.calc-field select {
|
||||
background: var(--gray-900);
|
||||
border: 1px solid rgba(255,255,255,0.1);
|
||||
border-radius: 8px;
|
||||
padding: 11px 14px;
|
||||
color: var(--gray-100);
|
||||
font-size: 15px;
|
||||
font-family: inherit;
|
||||
width: 100%;
|
||||
outline: none;
|
||||
transition: border-color 0.15s;
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
.calc-field input:focus,
|
||||
.calc-field select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,0.2); }
|
||||
.calc-field input::placeholder { color: var(--gray-700); }
|
||||
.calc-field select {
|
||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394a3b8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
|
||||
background-repeat: no-repeat;
|
||||
background-position: right 14px center;
|
||||
padding-right: 36px;
|
||||
}
|
||||
.calc-field select option { background: var(--gray-800); color: var(--gray-100); }
|
||||
.input-prefix-wrap { position: relative; }
|
||||
.input-prefix {
|
||||
position: absolute;
|
||||
left: 13px;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
color: var(--gray-600);
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
pointer-events: none;
|
||||
}
|
||||
.input-prefix-wrap input { padding-left: 28px; }
|
||||
.calc-error {
|
||||
color: #f87171;
|
||||
font-size: 13px;
|
||||
margin: 8px 0;
|
||||
font-weight: 500;
|
||||
}
|
||||
.calc-submit-btn { width: 100%; justify-content: center; margin-top: 16px; }
|
||||
.calc-fine {
|
||||
font-size: 11px;
|
||||
color: var(--gray-700);
|
||||
text-align: center;
|
||||
margin-top: 10px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
/* ── Results ── */
|
||||
.result-highlight {
|
||||
background: linear-gradient(135deg, rgba(79,70,229,0.18), rgba(14,165,233,0.12));
|
||||
border: 1px solid rgba(79,70,229,0.4);
|
||||
border-radius: var(--radius);
|
||||
padding: 28px;
|
||||
text-align: center;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.result-label {
|
||||
font-size: 12px;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.08em;
|
||||
color: var(--gray-500);
|
||||
font-weight: 700;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.result-amount {
|
||||
font-size: 52px;
|
||||
font-weight: 900;
|
||||
letter-spacing: -0.03em;
|
||||
color: var(--green);
|
||||
line-height: 1.1;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
.result-comparison {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 12px;
|
||||
flex-wrap: wrap;
|
||||
font-size: 14px;
|
||||
color: var(--gray-400);
|
||||
}
|
||||
.result-badge {
|
||||
background: rgba(34,197,94,0.15);
|
||||
border: 1px solid rgba(34,197,94,0.35);
|
||||
color: var(--green);
|
||||
padding: 3px 12px;
|
||||
border-radius: 99px;
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.result-breakdown {
|
||||
background: rgba(255,255,255,0.03);
|
||||
border: 1px solid rgba(255,255,255,0.07);
|
||||
border-radius: var(--radius);
|
||||
padding: 16px 20px;
|
||||
margin-bottom: 20px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
}
|
||||
.result-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
font-size: 14px;
|
||||
color: var(--gray-400);
|
||||
}
|
||||
.result-row-val { font-weight: 700; color: var(--gray-200); }
|
||||
.calc-ai-bubble {
|
||||
background: rgba(79,70,229,0.12);
|
||||
border: 1px solid rgba(79,70,229,0.3);
|
||||
border-radius: var(--radius);
|
||||
padding: 18px 20px;
|
||||
margin-bottom: 24px;
|
||||
font-size: 14px;
|
||||
color: var(--gray-200);
|
||||
line-height: 1.65;
|
||||
}
|
||||
.calc-ai-bubble .ai-label {
|
||||
display: block;
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
color: #a5b4fc;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.06em;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.calc-cta { text-align: center; }
|
||||
.calc-cta > p { color: var(--gray-400); font-size: 15px; margin-bottom: 16px; }
|
||||
.calc-cta-btn { width: 100%; justify-content: center; margin-bottom: 12px; }
|
||||
.calc-recalc { font-size: 14px; color: var(--gray-500); }
|
||||
.calc-recalc:hover { color: var(--gray-200); }
|
||||
|
||||
/* ---- Screenshot Carousel ---- */
|
||||
.screenshot-carousel {
|
||||
width: 100%;
|
||||
|
||||
Reference in New Issue
Block a user