/* ===== Brand & Global ===== */
body {
  margin: 0;
  font-family: 'Roboto', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
}

h1, h2 {
  font-family: 'Roboto', sans-serif;
  font-weight: bold;
  margin: 0 0 10px;
}

h3 {
  font-family: 'Roboto', sans-serif;
  font-weight: bold;
  margin: 0 0 10px;
  text-align: center;
}

a {
  color: #d8bd7d;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Larger font size for readability */
input, select, button, .calc-section label, .calc-section p {
  font-size: 18px;
}

/* Bold numbers in results */
.calc-section strong {
  font-size: 18px;
  font-weight: bold;
}

/* ===== Header ===== */
.site-header {
  background: #11152d;
  color: #fff;
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.site-header .brand {
  font-size: 1.4rem;
  font-weight: bold;
  color: #faf2aa;
}
.site-header nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 20px;
}
.site-header nav a {
  color: #b9c7d9;
  font-weight: bold;
}
.site-header nav a.active {
  color: #d8bd7d;
}

/* ===== Hero Section ===== */
.hero {
  text-align: center;
  padding: 20px 20px; /* smaller padding */
  background: linear-gradient(to right, #181c40 0%, #5290c9 50%, #181c40 100%);
  color: #fff;
}
.hero h2 {
  font-size: 1.5rem; /* shrink heading */
  margin-bottom: 5px;
}
.hero p {
  margin: 0;
  font-size: 1rem; /* smaller tagline */
}

.cta-button {
  display: inline-block;
  padding: 12px 24px;
  background: #d8bd7d;
  color: #181c40;
  border-radius: 8px;
  border: none;
  font-weight: bold;
}
.cta-button {
  display: inline-block;
  padding: 12px 24px;
  background: #d8bd7d;
  color: #181c40;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.cta-button:hover {
  background: #faf2aa;
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.4);
}

.cta-button:focus {
  outline: 2px solid #d8bd7d;
  outline-offset: 2px;
}



/* ==== Calculator Container ==== */
.calculator-container {
  max-width: 900px;
  margin: 10px auto;
  padding: 0 20px;
}

/* ==== Calculator Sections ==== */
.calc-section {
  background: rgba(255,255,255,0.05);
  border: 2px solid #d8bd7d;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 15px;        /* spacing between inputs */
}

.calc-section h3 {
  margin-bottom: 15px;
  font-size: 1.4rem;   /* slightly larger than inputs */
  font-weight: bold;
  color: #d8bd7d;      /* gold */
}
/* Table layout */
.calc-section table {
  width: 100%;
  border-collapse: collapse; /* ensures borders line up */
  table-layout: fixed; /* evenly distribute columns */
}

/* Headers and cells */
.calc-section th,
.calc-section td {
  padding: 8px 12px;
  text-align: right; /* numbers aligned to the right */
  border: 1px solid rgba(255, 255, 255, 0.2); /* 50% transparent border */
  color: #fff;
}

/* Left-align first column (Year) */
.calc-section th:first-child,
.calc-section td:first-child {
  text-align: center;
}

/* Header row */
.calc-section thead th {
  font-weight: bold;
  background-color: rgba(255, 255, 255, 0.05); /* subtle background */
}

/* Final row highlighted in gold */
.calc-section tbody tr:last-child {
  font-weight: bold;
  border: 2px solid #d8bd7d; /* thicker top border */
  background-color: transparent; /* removes tint*/
}
/* Default text for last row (keep white) */
.calc-section tbody tr:last-child td {
  color: #fff;
}

/* Only Closing Balance (last cell) in gold */
.calc-section tbody tr:last-child td:last-child {
  color: #d8bd7d;
}

.calc-section tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.05);
}



/* ==== Form Labels & Inputs ==== */
label {
   flex: 1 1 200px;    /* each input grows, min width 200px */
  display: flex;
  flex-direction: column; /* stack label + input */
  flex: 1 1 calc(33.333% - 16px);
  min-width: 250px;
  margin-bottom: 14px;
  font-weight: bold;
  color: #fff;font-size:1rem;
}

.input-grid .button-container {
  flex: 1 1 100%; /* make it take a full row*/
  display: flex; /* enable flexbox inside */
  justify-content: center; /* center the button */
  margin-top: 10px;    /* space from inputs */
  margin-bottom: 30px;   /* no bottom margin */
} 

input, select {
  width: 100%;
  padding: 14px 20px;   /* larger padding for big click/tap area */
  margin-top: 10px;     /* extra space between rows */
  border-radius: 8px;
  border: 2px solid #b9c7d9;
  background: #181c40;
  color: #fff;
  font-size: 18px;      /* 👀 bigger text for accessibility */
  box-sizing: border-box; /* padding won’t shrink input */
}
 
.input-grid {
  display: flex;
  flex-wrap: wrap;      /* allows rows to wrap */
  gap: 16px;            /* spacing between items */
}

.input-grid label {
  display: flex;
  flex-direction: column;
  flex: 1 1 calc(33.333% - 16px); /* 3 columns on desktop */
  min-width: 250px;               /* prevents squishing */
  font-weight: bold;
  color: #fff;
}

/* Inputs */
.input-grid input,
.input-grid select {
  width: 100%;
  padding: 14px 20px;
  margin-top: 10px;
  border-radius: 8px;
  border: 2px solid #b9c7d9;
  background: #181c40;
  color: #fff;
  font-size: 18px;
  box-sizing: border-box;
}


/* ===== Savings Boxes ===== */
.savings-box {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 12px;
  padding: 12px;
  margin-top: 10px;
  font-size: 0.9rem;
  color: #fff;
}
.savings-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.savings-line:last-child {
  margin-bottom: 0;
}
.icon-interest {
  color: #ff4d4f; /* red for money saved */
}
.icon-time {
  color: #ff9800; /* orange for time saved */
}
.savings-note {
  font-size: 0.8rem;
  opacity: 0.8;
}

/* ===== Piggy Bank Box ===== */
.piggy-box {
  background: #2e365f;
  border: 2px solid #d8bd7d;
  border-radius: 16px;
  text-align: center;
  padding: 20px;
}
.piggy-box h3 {
  margin-bottom: 10px;
  color: #d8bd7d;
}
/* Final outcome two-column layout */
#compoundSummary {
  display: grid;
  grid-template-columns: 1fr 1fr;/* labels in left, values in right */
  gap: 10px 20px;
  text-align: left;
  max-width: 500px;
  margin: 0 auto;
  text-align: left;
}
#compoundsummary .label {
  font-weight: bold;
  color: #fff;
}

#compoundChart {
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 10px;
  max-height: 500px;
}


/* Final outcome layout */
.outcome-columns {
  display: grid;
  grid-template-columns: 1fr 1fr; /* two equal columns */
  gap: 40px;
  max-width: 700px;
  margin: 0 auto;
}

.outcome-row {
  display: flex;
  justify-content: space-between;
  margin: 8px 0;
  font-size: 18px;
  white-space: nowrap; /* stops wrapping */
}

.outcome-row span {
  color: #fff;
}

.outcome-row .value {
  color: #fff; /* default for all values */
  margin-left: 15px;
}

.outcome-row .final-balance {
  color: #d8bd7d; /* gold for final balance */
  font-size: 20px;
  font-weight: bold;
}

.chartjs-tooltip .final {
  color: #d8bd7d !important;
  font-weight: bold;
}


/* Responsive: stack inputs on mobile */
@media (max-width: 768px) {
  .input-grid label {
    flex: 1 1 100%; /* full width */
    min-width: 100%;
  }
}


.piggy-box .outcome-grid p {
  margin: 5px 0;
  font-size: 18px;
}
/* Style for results */
.piggy-box p {
  font-size: 18px;
  margin: 6px 0;
}

.piggy-box p strong {
  color: #ffffff;
}

/* Highlight Final Balance */
.piggy-box p.final-balance strong {
  color: #d8bd7d; /* gold highlight */
  font-size: 20px;
}

.combined-savings {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-top: 10px;
  font-weight: bold;
}

/* ===== Loan Summary ===== */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.summary-grid div {
  background: rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
}
.summary-value {
  font-size: 1.1rem;
  font-weight: bold;
  color: #d8bd7d;
}

/* ===== Amortization Table ===== */
.amortization-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.amortization-table th,
.amortization-table td {
  border: 1px solid rgba(255,255,255,0.2);
  padding: 8px;
  text-align: right;
}
.amortization-table th {
  background: #2e365f;
  text-align: center;
}
.amortization-table td:first-child {
  text-align: center;
}
.amortization-table tr:nth-child(even) {
  background: rgba(255,255,255,0.05);
}
.amortization-table tr.font-bold {
  font-weight: bold;
  background: rgba(255,255,255,0.15);
}

/* ===== Footer ===== */
.site-footer {
  text-align: center;
  padding: 20px;
  font-size: 0.85rem;
  color: #b9c7d9;
  margin-top: 40px;
}


nav a.active {
  font-weight: bold;
  text-decoration: underline;
  color: #d8bd7d; /* gold highlight */
}

/* ==== Responsive (mobile view) ==== */
@media (max-width: 768px) {
.input-grid label {
    flex: 1 1 100%;
    min-width: 100%;
  }
}