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

:root {
  --orange:   #c05621;
  --orange-lt:#dd6b20;
  --green:    #276749;
  --red:      #c53030;
  --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(--orange); 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: #fbd38d; }
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(--orange), var(--orange-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: 360px 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(--orange); margin-bottom: 1.25rem; }

.loan-tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .75rem; }
.loan-tab { flex: 1; padding: .4rem .5rem; border: 1.5px solid var(--border); border-radius: 6px; background: #fff; font-size: .82rem; font-weight: 600; cursor: pointer; color: var(--muted); transition: all .15s; white-space: nowrap; }
.loan-tab.active { background: var(--orange); border-color: var(--orange); color: #fff; }
.loan-desc { font-size: .8rem; color: var(--muted); margin-bottom: 1.25rem; line-height: 1.5; }

.field-group { margin-bottom: .875rem; }
.field-group label { display: block; font-size: .82rem; font-weight: 600; color: var(--muted); margin-bottom: .3rem; }
.optional { font-weight: 400; font-size: .75rem; }
.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(--orange); }
.hint { font-size: .75rem; color: var(--muted); margin-top: .2rem; display: block; }
.divider { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }
.term-row { display: flex; gap: .5rem; }
.term-row input { flex: 1; }
.term-row select { width: 110px; }

/* Results */
.results-col { display: flex; flex-direction: column; }
.summary-card { border-top: 4px solid var(--orange); }
.monthly-amount { font-size: clamp(2rem, 5vw, 2.8rem); font-weight: 800; color: var(--orange); margin-bottom: .15rem; }
.monthly-sub { font-size: .82rem; color: var(--muted); margin-bottom: 1rem; }

.affordability { padding: .5rem .75rem; border-radius: 6px; margin-bottom: 1rem; font-size: .85rem; font-weight: 600; }
.afford-ok   { background: #c6f6d5; color: var(--green); }
.afford-warn { background: #feebc8; color: #c05621; }
.afford-bad  { background: #fed7d7; color: var(--red); }

.result-pills { display: flex; gap: .75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.pill { flex: 1; min-width: 90px; background: #fffaf0; border: 1px solid #fbd38d; border-radius: 8px; padding: .6rem .75rem; text-align: center; }
.interest-pill { background: #fff5f5; border-color: #fed7d7; }
.fee-pill { background: #f8f8f8; border-color: var(--border); }
.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(--orange); margin-top: .15rem; }
.interest-pill .pill-val { color: var(--red); }

.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(--orange); transition: width .3s; }
.bar-interest  { background: var(--red); transition: width .3s; }
.bar-legend { display: flex; gap: 1rem; font-size: .75rem; color: var(--muted); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: .3rem; vertical-align: middle; }
.dot-principal { background: var(--orange); }
.dot-interest  { background: var(--red); }

.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; }
.red { color: var(--red); font-weight: 600; }

/* Table */
.content-section { margin: 3rem 0; }
.content-section h2 { font-size: 1.4rem; font-weight: 800; color: var(--orange); 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(--orange); 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: #fffaf0; }
.rates-table td:nth-child(2) { color: var(--red); font-weight: 600; }
.table-note { font-size: .8rem; color: var(--muted); margin-top: .75rem; }

/* Compare */
.compare-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.compare-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.compare-card h3 { font-size: .95rem; font-weight: 700; color: var(--orange); margin-bottom: .4rem; }
.compare-card p { font-size: .875rem; color: var(--muted); line-height: 1.6; }

/* 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(--orange); 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(--orange); color: rgba(255,255,255,.7); padding: 1.5rem 0; margin-top: 3rem; text-align: center; font-size: .82rem; }
.site-footer a { color: #fbd38d; text-decoration: none; }
.site-footer p + p { margin-top: .4rem; }
