/* --- Global Styles --- */
body {
  font-family: 'Segoe UI', Arial, sans-serif;
  padding: 20px;
  background-color: #f7f9fc;
  color: #222;
  line-height: 1.5;
}

/* --- Buttons --- */
button {
  padding: 12px 20px;
  font-size: 1rem;
  background-color: #0070f3;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
button:hover {
  background-color: #005bb5;
}

/* --- Output Message --- */
#output {
  margin-top: 20px;
  font-size: 18px;
  color: #333;
}

/* --- Calculator Intro --- */
#calculator-intro {
  max-width: 600px;
  margin: 0 auto 30px;
  text-align: center;
}
#calculator-intro h1 {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
#calculator-intro p {
  font-size: 1.05rem;
  color: #555;
}

/* --- Calculator Form --- */
form#credit-form {
  display: flex;
  flex-direction: column;
  max-width: 600px;
  margin: 0 auto;
  gap: 1.2rem;
  background: #ffffff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
form#credit-form label {
  font-weight: 500;
}
form#credit-form input[type="number"],
form#credit-form select {
  padding: 10px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  width: 100%;
}

/* --- Tooltip Styling --- */
.tooltip {
  position: relative;
  cursor: help;
  display: inline-block;
  margin-left: 6px;
  color: #0070f3;
  font-weight: bold;
}
.tooltip-text {
  visibility: hidden;
  width: 230px;
  background-color: rgba(0, 0, 0, 0.85);
  color: #fff;
  text-align: left;
  border-radius: 6px;
  padding: 8px;
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.3s ease;
  font-size: 0.85rem;
  z-index: 100;
  line-height: 1.3;
}
.tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* --- Results Section & Table --- */
#results {
  max-width: 700px;
  margin: 30px auto;
}
#results table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
}
#results th,
#results td {
  padding: 12px 8px;
  text-align: center;
  border-bottom: 1px solid #eaeaea;
}
#results th {
  background: #f0f4f8;
  font-weight: 600;
}
#results tr:last-child td {
  border-bottom: none;
}
#results h3 {
  margin-top: 20px;
  font-size: 1.2rem;
  text-align: left;
}
#results ul {
  list-style: none;
  margin-top: 10px;
}
#results li {
  margin-bottom: 6px;
  font-size: 1rem;
}

/* --- Chart Canvases --- */
#results canvas {
  display: block;
  max-width: 100%;
  margin: 24px auto;
}

/* --- Disclosure Section --- */
#disclosures {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 600px;
  margin: 40px auto 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #555;
  padding: 20px;
  background-color: #f9f9f9;
  border-left: 4px solid #ccc;
  text-align: left;
}
#disclosures h2 {
  margin-top: 0;
  font-size: 1.2rem;
  color: #333;
}

#calculator-intro h1,
#calculator-intro p {
  text-align: left;
}

#results-section {
  max-width: 700px;
  margin: 30px auto;
}
#results-section h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #222;
  text-align: left;
}

.section-divider {
  height: 2px;
  background: linear-gradient(to right, #e0e0e0, #ccc, #e0e0e0);
  margin: 3rem auto;
  border: none;
  max-width: 800px;
  width: 100%;
  opacity: 0.8;
  border-radius: 1px;
}
