/* CalcWise — Shared Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600;9..40,700&display=swap');

:root {
  --primary: #1b6cf2;
  --primary-dk: #1456c8;
  --primary-lt: #eff4ff;
  --green: #00b386;
  --green-lt: #e6f9f5;
  --red: #ef4444;
  --amber: #f59e0b;
  --bg: #f4f6fa;
  --surface: #fff;
  --border: #e2e6ed;
  --text: #1a1f36;
  --muted: #64748b;
  --subtle: #94a3b8;
  --r: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.07), 0 4px 16px rgba(0,0,0,.04);
  --shadow-lg: 0 4px 28px rgba(0,0,0,.10);
}

*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'DM Sans', system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
main { flex: 1; }

/* HEADER */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; box-shadow: 0 1px 8px rgba(0,0,0,.05); }
.header-inner { max-width: 1200px; margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: center; gap: 28px; }
.logo { font-size: 20px; font-weight: 700; letter-spacing: -.5px; color: var(--primary); white-space: nowrap; text-decoration: none !important; }
.logo b { color: var(--text); }
.site-nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a { padding: 5px 11px; border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--muted); white-space: nowrap; transition: all .15s; }
.site-nav a:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.site-nav a.active { background: var(--primary-lt); color: var(--primary); font-weight: 600; }

/* LAYOUT */
.container { max-width: 1200px; margin: 0 auto; padding: 32px 24px 64px; }
.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 27px; font-weight: 700; letter-spacing: -.5px; margin-bottom: 4px; }
.page-header p { color: var(--muted); font-size: 15px; }
.content-layout { display: grid; grid-template-columns: 1fr 300px; gap: 24px; align-items: start; }
@media (max-width: 880px) { .content-layout { grid-template-columns: 1fr; } .sidebar { display: none; } }

/* CARDS */
.card { background: var(--surface); border-radius: var(--r); border: 1px solid var(--border); box-shadow: var(--shadow); padding: 26px; margin-bottom: 20px; }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 18px; color: var(--text); }

/* FORM */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 600px) { .form-grid, .form-grid.cols-3 { grid-template-columns: 1fr; } }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.full { grid-column: 1 / -1; }
label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.input-wrap { position: relative; display: flex; align-items: center; }
.pfx, .sfx { position: absolute; font-size: 14px; font-weight: 600; color: var(--muted); pointer-events: none; z-index: 1; }
.pfx { left: 11px; }
.sfx { right: 11px; }
input[type=number], input[type=text], select {
  width: 100%; height: 42px; border: 1.5px solid var(--border); border-radius: 8px;
  font-family: inherit; font-size: 15px; font-weight: 500; color: var(--text);
  background: var(--surface); padding: 0 12px; transition: border-color .15s, box-shadow .15s;
  -moz-appearance: textfield;
}
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; }
input:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(27,108,242,.1); }
.has-pfx input { padding-left: 26px; }
.has-sfx input { padding-right: 36px; }
select { padding-right: 36px; appearance: none;
  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' stroke-linecap='round' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}

/* BUTTON */
.btn { display: inline-flex; align-items: center; justify-content: center; height: 48px; border: none; border-radius: 9px; font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer; transition: background .15s, transform .1s; }
.btn-primary { background: var(--primary); color: #fff; padding: 0 24px; }
.btn-primary:hover { background: var(--primary-dk); }
.btn-primary:active { transform: scale(.99); }
.btn-full { width: 100%; margin-top: 18px; }
.btn-sm { height: 34px; font-size: 13px; padding: 0 14px; }

/* RESULTS */
.results { display: none; }
.results.show { display: block; }
.result-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 24px; }
.result-box { background: var(--bg); border-radius: 10px; padding: 15px; text-align: center; }
.result-box .lbl { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin-bottom: 5px; }
.result-box .val { font-size: 22px; font-weight: 700; letter-spacing: -.5px; }
.val.green { color: var(--green); }
.val.blue { color: var(--primary); }
.val.red { color: var(--red); }
.val.amber { color: var(--amber); }
.chart-wrap { position: relative; height: 260px; }

/* ADS — Replace .ad-placeholder with your AdSense <ins> tag */
.ad-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: #f0f2f6; border: 1.5px dashed #c5ccd6; border-radius: 8px; color: var(--subtle); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .8px; }
.ad-sidebar { width: 300px; height: 250px; }
.ad-inline { width: 100%; height: 90px; margin: 20px 0; }

/* SIDEBAR */
.sidebar-block { margin-bottom: 18px; }
.sidebar-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); }
.sidebar-card h3 { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 12px; }
.related-list { list-style: none; }
.related-list li { padding: 7px 0; border-bottom: 1px solid var(--border); }
.related-list li:last-child { border-bottom: none; }
.related-list a { font-size: 14px; font-weight: 500; }
.tip-card { background: var(--primary-lt); border: 1px solid rgba(27,108,242,.15); border-radius: var(--r); padding: 16px; }
.tip-card h3 { font-size: 12px; font-weight: 600; color: var(--primary); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .4px; }
.tip-card p { font-size: 13px; color: #2d4a8a; line-height: 1.55; }

/* FOOTER */
.site-footer { background: #0f172a; color: #64748b; padding: 48px 24px 24px; }
.footer-inner { max-width: 1200px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 40px; }
.footer-brand .logo { color: #e2e8f0; }
.footer-brand .logo b { color: #94a3b8; }
.footer-brand p { margin-top: 8px; font-size: 13px; color: #475569; max-width: 240px; line-height: 1.6; }
.footer-col h4 { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .6px; color: #94a3b8; margin-bottom: 12px; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { font-size: 13px; color: #475569; transition: color .15s; }
.footer-col a:hover { color: #e2e8f0; text-decoration: none; }
.footer-bottom { max-width: 1200px; margin: 32px auto 0; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.06); font-size: 12px; color: #334155; }

/* HOMEPAGE */
.hero { background: linear-gradient(135deg, #1050c0 0%, #1b6cf2 60%, #0096e0 100%); padding: 68px 24px; text-align: center; color: #fff; }
.hero h1 { font-size: 42px; font-weight: 700; letter-spacing: -1px; margin-bottom: 10px; text-wrap: balance; }
.hero p { font-size: 18px; opacity: .82; max-width: 480px; margin: 0 auto; }
.calc-section { max-width: 1200px; margin: 0 auto; padding: 48px 24px 64px; }
.section-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin-bottom: 20px; }
.calc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 18px; }
.calc-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 24px; box-shadow: var(--shadow); transition: box-shadow .2s, transform .2s; display: block; color: var(--text); }
.calc-tile:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); text-decoration: none; }
.tile-icon { width: 44px; height: 44px; border-radius: 11px; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.calc-tile h3 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.calc-tile p { font-size: 13px; color: var(--muted); line-height: 1.5; }
.tile-cta { font-size: 13px; font-weight: 600; color: var(--primary); margin-top: 12px; }

/* DISCLAIMER */
.disclaimer { background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 12px 16px; font-size: 12px; color: #92400e; margin-top: 8px; line-height: 1.5; }

/* DEBT TABLE */
.debt-table-wrap { overflow-x: auto; }
.debt-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.debt-table th { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--border); text-align: left; }
.debt-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); }
.debt-input { width: 100%; height: 34px; border: 1px solid var(--border); border-radius: 6px; font-family: inherit; font-size: 13px; padding: 0 8px; background: var(--surface); }
.debt-input:focus { outline: none; border-color: var(--primary); }
.remove-btn { background: none; border: none; color: var(--subtle); cursor: pointer; font-size: 18px; padding: 2px 6px; border-radius: 4px; line-height: 1; }
.remove-btn:hover { background: #fee2e2; color: var(--red); }
.add-row-btn { background: none; border: none; font-family: inherit; font-size: 13px; font-weight: 600; color: var(--primary); cursor: pointer; padding: 10px 0; display: block; }
.add-row-btn:hover { text-decoration: underline; }

/* BUDGET */
.budget-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.budget-row label { font-size: 14px; font-weight: 500; flex: 1; color: var(--text); text-transform: none; letter-spacing: 0; }
.budget-row input { width: 130px; }
.cat-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* NET WORTH */
.nw-group-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 16px 0 10px; }
.nw-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.nw-row label { font-size: 14px; flex: 1; color: var(--text); text-transform: none; letter-spacing: 0; font-weight: 400; }
.nw-row input { width: 150px; }

/* PROGRESS BAR */
.progress-bar { height: 8px; background: var(--border); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.progress-fill { height: 100%; border-radius: 99px; transition: width .4s; }
