*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --indigo:   #3730a3;
  --indigo-lt:#4338ca;
  --green:    #15803d;
  --bg:       #f5f7fa;
  --border:   #e2e8f0;
  --text:     #1a202c;
  --muted:    #718096;
  --radius:   10px;
  --shadow:   0 2px 12px rgba(0,0,0,.08);
}

body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }
.container { max-width: 1080px; margin: 0 auto; padding: 0 1.25rem; }

.site-header { background: var(--indigo); padding: .875rem 0; position: sticky; top: 0; z-index: 100; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; }
.logo { font-size: 1.25rem; font-weight: 800; color: #fff; }
.logo span { color: #a5b4fc; }
nav a { color: rgba(255,255,255,.85); text-decoration: none; margin-left: 1.5rem; font-size: .9rem; }
nav a:hover { color: #fff; }

.hero { background: linear-gradient(135deg, var(--indigo), var(--indigo-lt)); color: #fff; padding: 3rem 0 2.5rem; text-align: center; }
.hero h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 800; margin-bottom: .75rem; }
.hero-sub { font-size: 1.05rem; opacity: .88; max-width: 560px; margin: 0 auto; }

.calc-layout { display: grid; grid-template-columns: 340px 1fr; gap: 1.5rem; margin: 2rem 0; align-items: start; }
@media (max-width: 768px) { .calc-layout { grid-template-columns: 1fr; } }

.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); margin-bottom: 1.25rem; }
.card h2 { font-size: 1.05rem; font-weight: 700; color: var(--indigo); margin-bottom: 1.25rem; }
.card h3 { font-size: .95rem; font-weight: 700; color: var(--text); margin-bottom: .875rem; }

.field-group { margin-bottom: .875rem; }
.field-group label { display: block; font-size: .82rem; font-weight: 600; color: var(--muted); margin-bottom: .3rem; }
.field-group input, .field-group select { width: 100%; padding: .55rem .75rem; border: 1.5px solid var(--border); border-radius: 6px; font-size: .95rem; color: var(--text); transition: border-color .15s; }
.field-group input:focus, .field-group select:focus { outline: none; border-color: var(--indigo); }
.hint { font-size: .75rem; color: var(--muted); margin-top: .2rem; display: block; }
.divider { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }

/* Results */
.results-col { display: flex; flex-direction: column; gap: 0; }
.summary-card { border-top: 4px solid var(--indigo); }
.result-hero { text-align: center; padding: 1rem 0 .75rem; }
.result-label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.result-amount { font-size: clamp(2rem, 5vw, 2.8rem); font-weight: 800; color: var(--indigo); margin: .25rem 0; }

.result-pills { display: flex; gap: .75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.pill { flex: 1; min-width: 90px; background: #f8f7ff; border: 1px solid #e0e7ff; border-radius: 8px; padding: .6rem .75rem; text-align: center; }
.interest-pill { background: #f0fdf4; border-color: #bbf7d0; }
.pill-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.pill-val { font-size: 1rem; font-weight: 800; color: var(--indigo); margin-top: .15rem; }
.interest-pill .pill-val { color: var(--green); }

.stack-bar-wrap { margin: .5rem 0 1rem; }
.stack-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; margin-bottom: .4rem; }
.bar-principal     { background: var(--indigo); transition: width .3s; }
.bar-contributions { background: #7c3aed; transition: width .3s; }
.bar-interest      { background: var(--green); transition: width .3s; }
.bar-legend { display: flex; gap: 1rem; font-size: .75rem; color: var(--muted); flex-wrap: wrap; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: .3rem; vertical-align: middle; }
.dot-principal     { background: var(--indigo); }
.dot-contributions { background: #7c3aed; }
.dot-interest      { background: var(--green); }

.breakdown { border-top: 1px solid var(--border); padding-top: .75rem; }
.breakdown-row { display: flex; justify-content: space-between; padding: .35rem 0; font-size: .88rem; border-bottom: 1px dashed var(--border); }
.breakdown-row:last-child { border-bottom: none; }
.breakdown-row.highlight { font-weight: 700; font-size: 1rem; }
.green { color: var(--green); font-weight: 600; }

/* Formula */
.formula-card { font-family: 'Georgia', serif; }
.formula-display { font-size: 1.4rem; text-align: center; color: var(--indigo); padding: .75rem; background: #f8f7ff; border-radius: 6px; margin-bottom: .875rem; letter-spacing: .03em; }
.formula-vars { font-size: .875rem; }
.var-row { padding: .2rem 0; color: var(--muted); }
.var { display: inline-block; min-width: 2rem; font-weight: 700; font-style: italic; color: var(--indigo); }

/* Table */
.content-section { margin: 3rem 0; }
.content-section h2 { font-size: 1.4rem; font-weight: 800; color: var(--indigo); margin-bottom: 1rem; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .875rem; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.data-table th { background: var(--indigo); color: #fff; padding: .6rem 1rem; text-align: right; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.data-table th:first-child { text-align: left; }
.data-table td { padding: .55rem 1rem; border-bottom: 1px solid var(--border); text-align: right; }
.data-table td:first-child { text-align: left; font-weight: 600; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:nth-child(even) td { background: #f8f9ff; }
.data-table tr.partial td { color: var(--muted); font-size: .82rem; }

/* FAQ */
.faq-list { display: flex; flex-direction: column; gap: .75rem; }
details { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; box-shadow: var(--shadow); }
summary { font-weight: 600; cursor: pointer; font-size: .95rem; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::before { content: '+ '; color: var(--indigo); font-weight: 800; }
details[open] summary::before { content: '− '; }
details p { margin-top: .6rem; font-size: .875rem; color: var(--muted); line-height: 1.7; }

.site-footer { background: var(--indigo); color: rgba(255,255,255,.7); padding: 1.5rem 0; margin-top: 3rem; text-align: center; font-size: .82rem; }
.site-footer a { color: #a5b4fc; text-decoration: none; }
.site-footer p + p { margin-top: .4rem; }
