@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@600;700;800&display=swap');

:root {
  --ink: #14233a;
  --muted: #66758a;
  --navy: #092b4c;
  --navy-deep: #061f38;
  --blue: #1468a7;
  --cyan: #4bc2d5;
  --gold: #f3bb3b;
  --line: #dfe6ed;
  --surface: #f4f7fa;
  --white: #fff;
  --success: #25b083;
  --shadow: 0 18px 50px rgba(15, 42, 68, .11);
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--surface); font-family: "DM Sans", sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, strong { font-family: "Manrope", sans-serif; }

.hero { color: #fff; background: radial-gradient(circle at 88% 12%, rgba(75, 194, 213, .28), transparent 28%), linear-gradient(135deg, var(--navy-deep), var(--navy)); padding-bottom: 8.5rem; }
.navbar { padding: 1.3rem 0; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.navbar-brand { display: inline-flex; align-items: center; min-height: 3rem; color: #fff; line-height: 1; }
.brand-logo { display: block; width: clamp(9rem, 15vw, 13.75rem); height: auto; }
.hero .badge { color: var(--navy) !important; padding: .65rem .9rem; font-weight: 600; }
.hero-content { padding-top: 4.25rem; }
.eyebrow { display: block; color: var(--cyan); font-size: .74rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.hero h1 { max-width: 780px; margin: .75rem 0 1rem; font-size: clamp(2.15rem, 5vw, 4rem); font-weight: 800; line-height: 1.05; letter-spacing: -.04em; }
.hero p { max-width: 700px; margin: 0; color: rgba(255,255,255,.74); font-size: 1.08rem; }
.hero-note { display: flex; gap: .85rem; align-items: flex-start; padding: 1rem 1.1rem; color: rgba(255,255,255,.78); background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); border-radius: 1rem; font-size: .84rem; }
.hero-note-icon { display: grid; flex: 0 0 1.6rem; place-items: center; width: 1.6rem; height: 1.6rem; color: var(--navy); background: var(--cyan); border-radius: 50%; font-weight: 800; }

.page-shell { position: relative; z-index: 2; margin-top: -5.5rem; padding-bottom: 5rem; }
.intro-card, .section-heading { display: flex; gap: 1rem; align-items: flex-start; }
.intro-card { flex-wrap: wrap; padding: 2rem; background: #fff; border: 1px solid rgba(8, 43, 77, .06); border-radius: 1.25rem; box-shadow: var(--shadow); }
.intro-number { display: grid; flex: 0 0 2.6rem; place-items: center; width: 2.6rem; height: 2.6rem; color: var(--blue); background: #e8f2f9; border-radius: .8rem; font-family: "Manrope", sans-serif; font-size: .82rem; font-weight: 800; }
.intro-card h2, .section-heading h2 { margin: 0 0 .25rem; font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; }
.intro-card p, .section-heading p { margin: 0; color: var(--muted); font-size: .91rem; }
.section-heading { margin: 2rem 0 1rem; padding-left: .25rem; }
.form-label { margin-bottom: .5rem; color: #34445a; font-size: .84rem; font-weight: 600; }
.form-label > span { color: #d15858; }
.form-label .optional { margin-left: .3rem; color: #d15858; font-size: .68rem; font-weight: 500; text-transform: uppercase; }
.form-control, .form-select, .input-group-text { min-height: 3rem; border-color: #d8e0e8; }
.form-control, .form-select { color: var(--ink); font-size: .92rem; border-radius: .65rem; }
.form-control:focus, .form-select:focus { border-color: var(--cyan); box-shadow: 0 0 0 .22rem rgba(75,194,213,.16); }
.input-group .form-control { min-width: 0; }
.input-group-text { color: #657487; background: #eef3f7; font-size: .78rem; }
.step-actions { display: flex; flex-wrap: wrap; gap: .9rem; align-items: center; justify-content: flex-end; margin-top: .5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.step-actions .btn { min-width: 10.5rem; border: 0; background: linear-gradient(135deg, var(--blue), #0a4c7d); border-radius: .75rem; font-size: .9rem; font-weight: 800; box-shadow: 0 12px 24px rgba(20, 104, 167, .2); }
.step-actions .btn:hover, .step-actions .btn:focus { background: linear-gradient(135deg, #0a5f9e, var(--navy)); }
.step-actions small { max-width: 22rem; color: var(--muted); font-size: .75rem; text-align: right; }

.calculator-accordion { overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 1.25rem; box-shadow: 0 10px 36px rgba(15,42,68,.07); }
.calculator-accordion .accordion-item { border: 0; border-bottom: 1px solid var(--line); }
.calculator-accordion .accordion-item:last-child { border-bottom: 0; }
.calculator-accordion .accordion-button { gap: 1rem; padding: 1.35rem 1.5rem; color: var(--ink); background: #fff; box-shadow: none; }
.calculator-accordion .accordion-button:not(.collapsed) { color: var(--ink); background: #f9fbfd; }
.calculator-accordion .accordion-button strong, .calculator-accordion .accordion-button small { display: block; }
.calculator-accordion .accordion-button strong { margin-bottom: .18rem; font-size: .97rem; }
.calculator-accordion .accordion-button small { color: var(--muted); font-size: .77rem; }
.section-icon { display: grid; flex: 0 0 2.35rem; place-items: center; width: 2.35rem; height: 2.35rem; color: var(--blue); background: #eaf3fa; border-radius: .7rem; font-family: "Manrope", sans-serif; font-size: .72rem; font-weight: 800; }
.section-status { margin-left: auto; margin-right: .5rem; padding: .28rem .55rem; color: #4d6178; background: #eef2f5; border-radius: 2rem; font-size: .69rem; font-weight: 700; }
.accordion-body { padding: 1.5rem; background: #fbfcfd; }
.accordion-body h4 { margin-bottom: 1rem; color: #52637a; font-size: .76rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.section-help { margin-bottom: 1.35rem; padding: .85rem 1rem; color: #53657b; background: #edf5f9; border-left: 3px solid var(--cyan); border-radius: 0 .65rem .65rem 0; font-size: .8rem; }
.items-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.quantity-item { display: grid; grid-template-columns: 1fr 5.4rem; gap: .75rem; align-items: center; min-height: 4.1rem; padding: .75rem .85rem; background: #fff; border: 1px solid var(--line); border-radius: .75rem; }
.quantity-item label { margin: 0; color: #314158; font-size: .79rem; line-height: 1.25; }
.quantity-item .form-control { min-height: 2.6rem; text-align: center; }
.switch-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.switch-item { display: flex; gap: .75rem; align-items: center; min-height: 4rem; padding: .8rem 1rem; background: #fff; border: 1px solid var(--line); border-radius: .75rem; cursor: pointer; }
.switch-item:has(.form-check-input:checked) { background: #ecf8f5; border-color: #92d5c1; }
.switch-item .form-check-input { flex: 0 0 auto; width: 2.35rem; height: 1.25rem; margin: 0; cursor: pointer; }
.switch-item .form-check-input:checked { background-color: var(--success); border-color: var(--success); }
.switch-item span { color: #314158; font-size: .81rem; line-height: 1.25; }
.highlight-field { display: flex; gap: 1rem; align-items: center; justify-content: space-between; padding: 1rem 1.15rem; background: #fff; border: 1px solid var(--line); border-radius: .8rem; }
.highlight-field label { margin: 0; }
.highlight-field input { width: 7rem; text-align: center; }
.other-expense { padding: 1rem; background: #fff9eb; border: 1px dashed #edc96d; border-radius: .8rem; }
.other-expense-label { display: flex; gap: .5rem; align-items: center; justify-content: flex-start; margin-bottom: .5rem; }
.other-expense-label .form-label { margin-bottom: 0; }
.add-expense-btn, .remove-expense-btn { display: inline-grid; place-items: center; flex: 0 0 1.75rem; width: 1.75rem; height: 1.75rem; min-height: 0; padding: 0; border: 0; border-radius: 50%; font-weight: 800; line-height: 1; }
.add-expense-btn { color: #fff; background: linear-gradient(135deg, var(--blue), #0a4c7d); box-shadow: 0 8px 18px rgba(20,104,167,.18); }
.add-expense-btn:hover, .add-expense-btn:focus { color: #fff; background: linear-gradient(135deg, #0a5f9e, var(--navy)); }
.remove-expense-btn { color: #b44b4b; background: #fff; border: 1px solid #efc7c7; }
.remove-expense-btn:hover, .remove-expense-btn:focus { color: #fff; background: #d15858; border-color: #d15858; }
.extra-expenses { display: grid; gap: .75rem; margin-top: .85rem; }
.other-expense-row, .extra-expense-row { align-items: end; }
.extra-expense-row { padding-top: .85rem; border-top: 1px solid rgba(237, 201, 109, .55); }
.extra-expense-row .remove-col { display: flex; align-items: end; justify-content: center; }
.notes-card { padding: 1.5rem; color: #4b5c71; background: #fff; border: 1px solid var(--line); border-radius: 1rem; }
.notes-card h3 { margin-bottom: .8rem; color: var(--ink); font-size: .95rem; font-weight: 800; }
.notes-card ul { margin: 0; padding-left: 1.15rem; font-size: .78rem; }
.notes-card li + li { margin-top: .45rem; }

.result-column { position: sticky; top: 1.25rem; }
.result-card { overflow: hidden; padding: 1.75rem; color: #fff; background: radial-gradient(circle at 90% 5%, rgba(75,194,213,.22), transparent 26%), linear-gradient(160deg, #0b355c, #071f38 75%); border-radius: 1.25rem; box-shadow: 0 24px 60px rgba(4,31,55,.24); }
.result-card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 2rem; }
.live-dot { color: rgba(255,255,255,.62); font-size: .65rem; white-space: nowrap; }
.live-dot i { display: inline-block; width: .45rem; height: .45rem; margin-right: .25rem; background: #52d4aa; border-radius: 50%; box-shadow: 0 0 0 4px rgba(82,212,170,.1); }
.result-label { margin-bottom: .8rem; color: rgba(255,255,255,.64); font-size: .8rem; }
.result-range { display: grid; grid-template-columns: 1fr 1.8rem 1fr; gap: .6rem; align-items: center; }
.result-range div:last-child { text-align: right; }
.result-range small { display: block; margin-bottom: .22rem; color: var(--cyan); font-size: .65rem; font-weight: 700; text-transform: uppercase; }
.result-range strong { display: block; font-size: clamp(1.35rem, 3vw, 1.75rem); letter-spacing: -.04em; white-space: nowrap; }
.result-range > span { height: 1px; background: rgba(255,255,255,.24); }
.variation, .budget-title { display: flex; justify-content: space-between; align-items: center; }
.variation { margin: 1.25rem 0; padding: .65rem .8rem; color: rgba(255,255,255,.67); background: rgba(255,255,255,.07); border-radius: .6rem; font-size: .73rem; }
.variation strong { color: #fff; font-size: .78rem; }
.fraction-result { margin-bottom: 1.2rem; padding: .85rem; color: var(--navy); background: var(--gold); border-radius: .7rem; }
.fraction-result span, .fraction-result strong { display: block; }
.fraction-result > span { margin-bottom: .25rem; font-size: .68rem; font-weight: 700; text-transform: uppercase; }
.fraction-result strong span { display: inline; }
.result-card hr { margin: 1.35rem 0; border-color: rgba(255,255,255,.14); opacity: 1; }
.budget-title { gap: 1rem; margin-bottom: 1.25rem; font-size: .74rem; }
.budget-title span { color: rgba(255,255,255,.63); }
.budget-title strong { font-size: .75rem; text-align: right; }
.breakdown-row { margin-bottom: .9rem; }
.breakdown-row > div:first-child { display: flex; justify-content: space-between; margin-bottom: .35rem; color: rgba(255,255,255,.72); font-size: .69rem; }
.breakdown-row b { color: #fff; font-weight: 600; }
.breakdown-bar { overflow: hidden; height: .3rem; background: rgba(255,255,255,.1); border-radius: 2rem; }
.breakdown-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), #7bd9c4); border-radius: inherit; transition: width .25s ease; }
.result-actions { display: grid; gap: .35rem; margin-top: 1.75rem; }
.result-actions .btn-light { min-height: 2.85rem; color: var(--navy); font-size: .82rem; font-weight: 700; }
.result-actions .btn-link { color: rgba(255,255,255,.6); font-size: .73rem; text-decoration: none; }
.result-disclaimer { margin: 1rem .6rem 0; color: #6b798b; font-size: .68rem; text-align: center; }

footer { padding: 1.6rem 0; color: #718094; background: #eaf0f4; border-top: 1px solid #dce4eb; font-size: .72rem; }
footer a { color: var(--blue); font-weight: 700; text-decoration: none; }
footer a:hover { text-decoration: underline; }

@media (max-width: 1199.98px) {
  .result-column { position: static; order: -1; }
  .result-card { max-width: none; }
}
@media (max-width: 767.98px) {
  .hero { padding-bottom: 6.5rem; }
  .hero-content { padding-top: 2.75rem; }
  .hero h1 { font-size: 2.35rem; }
  .page-shell { margin-top: -4rem; }
  .intro-card { padding: 1.25rem; }
  .items-grid, .switch-grid { grid-template-columns: 1fr; }
  .accordion-body, .calculator-accordion .accordion-button { padding: 1.1rem; }
  .step-actions { justify-content: stretch; }
  .step-actions .btn { width: 100%; }
  .step-actions small { max-width: none; text-align: left; }
  .section-status { display: none; }
  .result-card { padding: 1.35rem; }
}

@media print {
  body { background: #fff; }
  .hero { padding-bottom: 2rem; }
  .navbar, .hero-note, .col-xl-8, footer, .result-actions, .result-disclaimer { display: none !important; }
  .page-shell { margin-top: 0; padding: 2rem 0; }
  .result-column { width: 100%; }
  .result-card { color: #111; background: #fff; border: 1px solid #bbb; box-shadow: none; }
  .result-card * { color: #111 !important; }
  .breakdown-bar { background: #ddd; }
  .breakdown-bar i { background: #555; }
}
