:root {
  --bg: #1e1e2f;
  --surface: #2e2e3e;
  --primary: #4a90e2;
  --text: #f0f0f0;
  --text-muted: #aaa;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
}

.page-wrapper {
  flex: 1;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

header h1 {
  font-size: 1.5rem;
  margin: 0;
}

header a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  transition: opacity 0.2s ease-in-out;
}

header a:hover {
  opacity: 0.8;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
}

.card {
  background: var(--surface);
  border-radius: 1.5rem;
  padding: 2rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  margin-bottom: 1.5rem;
}

h2 {
  margin-top: 0;
  font-size: 1.75rem;
  color: var(--text);
}

.form-group {
  margin-top: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

input[type="number"],
select {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid #444;
  background: #1e1e2f;
  color: white;
  font-size: 1rem;
  box-sizing: border-box;
}

input[type="number"]:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
}

/* Summary (Results) Card Styles */
.results-card p {
  font-size: 1.1rem;
  margin: 0.5rem 0;
}

/* Loan Type Button Group */
.loan-type-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.loan-type-button {
  padding: 1rem 2rem;
  border: 2px solid #444;
  background: var(--surface);
  color: white;
  font-size: 1rem;
  font-weight: bold;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background-color 0.3s;
  flex: 1;
}

.loan-type-button:hover {
  background: var(--primary);
}

.loan-type-button.selected {
  background: var(--primary);
}

/* Extra Payments */
#addExtraPayment {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 0.5rem;
  background: var(--primary);
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s;
}

#addExtraPayment:hover {
  background: #367ac7;
}

.extra-payment {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 1rem;
}

.extra-payment input[type="number"] {
  flex: 1;
}

/* Remove Extra Payment Button */
.removeExtraPayment {
  padding: 0.5rem 1rem;
  border: 2px solid #444;
  background: var(--surface);
  color: white;
  font-size: 0.9rem;
  font-weight: bold;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background-color 0.3s;
}

.removeExtraPayment:hover {
  background: var(--primary);
}

/* Table Styles */
.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

table th,
table td {
  padding: 0.75rem;
  border: 1px solid #444;
  text-align: center;
  font-size: 0.9rem;
}

footer {
  background-color: var(--surface);
  padding: 1.5rem 2rem;
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-muted);
  box-shadow: 0 -2px 8px rgba(0,0,0,0.2);
}

footer a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

footer a:hover {
  opacity: 0.8;
}

@media (max-width: 600px) {
  header, .container {
    padding: 1rem;
  }
}
