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

:root {
  --teal:     #234e52;
  --teal-lt:  #285e61;
  --green:    #276749;
  --red:      #e53e3e;
  --orange:   #ed8936;
  --gold:     #d69e2e;
  --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(--teal); 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: #81e6d9; }
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(--teal), var(--teal-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: 580px; margin: 0 auto; }

.calc-layout { display: grid; grid-template-columns: 380px 1fr; gap: 1.5rem; margin: 2rem 0; align-items: start; }
@media (max-width: 820px) { .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(--teal); margin-bottom: 1.25rem; }
.card h3 { font-size: .95rem; font-weight: 700; color: var(--text); margin-bottom: 1rem; }

.scheme-tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .75rem; }
.scheme-tab { flex: 1; padding: .4rem .5rem; border: 1.5px solid var(--border); border-radius: 6px; background: #fff; font-size: .8rem; font-weight: 600; cursor: pointer; color: var(--muted); transition: all .15s; white-space: nowrap; }
.scheme-tab.active { background: var(--teal); border-color: var(--teal); color: #fff; }
.scheme-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(--teal); }
.hint { font-size: .75rem; color: var(--muted); margin-top: .2rem; display: block; }
.divider { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }
.checkbox-group label { display: flex; align-items: center; gap: .5rem; font-size: .875rem; cursor: pointer; }
.checkbox-group input { accent-color: var(--teal); }

/* Results */
.results-col { display: flex; flex-direction: column; gap: 1.25rem; }
.summary-card { border-top: 4px solid var(--teal); }
.monthly-amount { font-size: clamp(2rem, 5vw, 2.8rem); font-weight: 800; color: var(--teal); 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); }

.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; color: var(--teal); border-top: 2px solid var(--border); padding-top: .5rem; }
.breakdown-row.interest-row span:last-child { color: var(--red); }
.breakdown-row.total-cash { font-weight: 700; color: var(--teal); }
.costs-note { font-size: .75rem; color: var(--muted); margin-top: .75rem; line-height: 1.5; }

/* Amort bar */
.amort-bar-wrap { margin-bottom: .75rem; }
.amort-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; margin-bottom: .4rem; }
.amort-principal { background: var(--teal); transition: width .3s; }
.amort-interest  { background: var(--red); transition: width .3s; }
.amort-legend { font-size: .78rem; color: var(--muted); display: flex; gap: 1rem; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: .3rem; vertical-align: middle; }
.principal-dot { background: var(--teal); }
.interest-dot  { background: var(--red); }
.amort-note { font-size: .82rem; color: var(--muted); margin-top: .5rem; }

/* Scheme table */
.content-section { margin: 3rem 0; }
.content-section h2 { font-size: 1.4rem; font-weight: 800; color: var(--teal); margin-bottom: 1.25rem; }
.scheme-table-wrap { overflow-x: auto; }
.scheme-table { width: 100%; border-collapse: collapse; font-size: .88rem; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.scheme-table th { background: var(--teal); color: #fff; padding: .65rem 1rem; text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.scheme-table td { padding: .6rem 1rem; border-bottom: 1px solid var(--border); }
.scheme-table tr:last-child td { border-bottom: none; }
.scheme-table .highlight-row td { background: #e6fffa; }
.table-note { font-size: .8rem; color: var(--muted); margin-top: .75rem; }

/* Closing costs grid */
.costs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.cost-item { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.cost-label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: .3rem; }
.cost-rate { font-size: 1.3rem; font-weight: 800; color: var(--teal); margin-bottom: .4rem; }
.cost-desc { font-size: .82rem; color: var(--muted); line-height: 1.5; }
.total-cost-item { border-color: var(--teal); }
.total-cost-item .cost-rate { color: var(--red); }

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