/* Calculator-specific styles; relies on global styles.css */

.inspect-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.inspect-bar .inspect-arithmetic-btn {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  text-decoration: none;
  border-radius: 10px;
}
.inspect-bar .inspect-arithmetic-btn:hover {
  text-decoration: none;
  color: var(--text);
  border-color: var(--accent);
  background: var(--accentSoft);
}

.panel {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
}

.lead {
  color: var(--muted);
  margin: 0 0 12px;
}

.intro-text {
  margin: 16px 0;
}

.intro-text p {
  margin: 8px 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

.calc-grid {
  display: grid !important;
  /* Slightly narrow the Results column (card 3) by ~10% while keeping proportions similar */
  grid-template-columns: 0.84fr 0.84fr 1.32fr !important;
  gap: 16px;
  margin-top: 16px;
}

@media (max-width: 900px) {
  .calc-grid {
    grid-template-columns: 1fr !important;
  }
}

.field {
  margin: 12px 0;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: var(--text);
}

.field input,
.field select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface, rgba(255,255,255,0.04));
  color: var(--text);
  font-size: 14px;
}

.field input:disabled,
.field select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.inline {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inline input {
  flex: 1;
}

.unit {
  opacity: 0.75;
  font-size: 14px;
}

.sep {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

.help {
  font-size: 13px;
  margin-top: 8px;
}

.muted {
  color: var(--muted);
}

.hidden {
  display: none;
}

.toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border);
  transition: 0.3s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text);
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

.calculated-payment {
  padding: 10px 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--accent);
  border-radius: 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  text-align: center;
}

.callout {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--accentSoft);
}

.callout h3 {
  color: var(--accent2);
  font-weight: 700;
}

.callout p {
  color: var(--text);
}

.callout a {
  color: var(--accent2);
  text-decoration: underline;
}

/* Full-width summary sentence at bottom of main calculator card */
.summary-sentence-card {
  width: 100%;
  margin-top: 20px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}
.summary-sentence-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
}

/* Slider container */
.slider-container {
  margin: 12px 0;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--muted);
}

.slider-labels span:nth-child(2) {
  font-weight: 700;
  color: var(--accent);
  font-size: 14px;
}

#allocation_slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  outline: none;
  -webkit-appearance: none;
}

#allocation_slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

#allocation_slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: none;
}

/* Results */
.results {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.result-card {
  padding: 12px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.result-card.primary {
  background: rgba(255,255,255,0.05);
  border-color: var(--accent);
}

.result-label {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 4px;
}

.result-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.result-value.highlight-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
}

/* Chart */
.chart-section {
  margin-top: 16px;
}

.chart-container {
  width: 100%;
  height: 400px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  position: relative;
}

#chartCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-top: 12px;
  font-size: 12px;
  justify-content: center;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  display: inline-block;
}

/* Key facts */
.key-facts {
  margin-top: 16px;
}

.fact-row {
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.fact-row:last-child {
  border-bottom: none;
}

.fact-text {
  margin: 0;
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
}

.fact-value {
  font-weight: 700;
  color: var(--text);
}

/* FAQ section (accordion style) */
.faq-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.faq-section h2 {
  margin: 0 0 20px;
  font-size: 20px;
  color: var(--text);
}

.faq-accordion {
  margin: 0;
}

.faq-accordion-item {
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.faq-accordion-item summary {
  cursor: pointer;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.03);
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.faq-accordion-item summary::-webkit-details-marker {
  display: none;
}

.faq-accordion-item summary::after {
  content: "+";
  font-size: 1.2em;
  color: var(--accent);
  flex-shrink: 0;
}

.faq-accordion-item[open] summary::after {
  content: "−";
}

.faq-accordion-item summary:hover {
  background: rgba(255, 255, 255, 0.05);
}

.faq-accordion-body {
  padding: 0 18px 16px;
  background: var(--surface);
}

.faq-accordion-body p {
  margin: 0 0 0.9em 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}

.faq-accordion-body p:last-child {
  margin-bottom: 0;
}

.disclaimer {
  margin-top: 24px;
  font-size: 12.5px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
}

.disclaimer p {
  margin: 0;
  color: var(--muted);
}
