/* calculator.css — interactive calculator widget */

/* =========================================================
   Calculator Container
   ========================================================= */
.calculator {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 28px 28px 24px;
}

/* =========================================================
   Calculator head (section label + icon)
   ========================================================= */
.calc-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.calc-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: var(--color-accent-tint);
  color: var(--color-accent-ink);
  flex-shrink: 0;
}

.calc-icon svg {
  width: 18px;
  height: 18px;
}

/* =========================================================
   Inputs
   ========================================================= */
.calculator__inputs,
.calc-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  align-items: end;
}

@media (max-width: 767px) {
  .calculator__inputs,
  .calc-grid {
    grid-template-columns: 1fr;
  }
}

.calc-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.calc-field--array {
  grid-column: 1 / -1;
}

.calc-field__label {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text);
}

.calc-field__hint {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.calc-field__input-wrap {
  display: flex;
  align-items: center;
  height: 48px;
  border: 1.5px solid var(--color-border-strong);
  border-radius: 7px;
  background: var(--color-surface);
  overflow: hidden;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.calc-field__input-wrap:focus-within {
  border-color: var(--color-accent);
  box-shadow: var(--focus-ring);
}

.calc-field__prefix,
.calc-field__suffix {
  padding: 0 10px;
  background: transparent;
  color: var(--color-text-faint);
  font-size: var(--font-size-sm);
  font-weight: 500;
  white-space: nowrap;
  user-select: none;
}

.calc-field__input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 10px;
  font-size: var(--font-size-base);
  font-family: var(--font-mono);
  border: none;
  background: transparent;
  color: var(--color-text);
  outline: none;
}

.calc-field__textarea {
  width: 100%;
  padding: var(--space-3) var(--space-3);
  font-size: var(--font-size-sm);
  font-family: var(--font-mono);
  border: 1.5px solid var(--color-border-strong);
  border-radius: 7px;
  background: var(--color-surface);
  color: var(--color-text);
  outline: none;
  resize: vertical;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.calc-field__textarea:focus {
  border-color: var(--color-accent);
  box-shadow: var(--focus-ring);
}

/* =========================================================
   Result block
   ========================================================= */
.calculator__output,
.calc-result-block {
  background: var(--color-accent-tint-2);
  border: 1px solid #D9ECE9;
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.calculator__result-label {
  font-size: var(--font-size-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin: 0;
}

.calculator__result-value {
  font-family: var(--font-mono);
  font-size: 44px;
  font-weight: 600;
  color: var(--color-accent-ink);
  letter-spacing: -0.02em;
  line-height: 1;
  margin: 0;
  transition: color var(--transition-fast);
}

.calculator__result-value[data-state="error"] {
  font-size: var(--font-size-2xl);
  color: var(--color-text-muted);
}

/* =========================================================
   Interpretation guide dot colors
   ========================================================= */
.interp-guide__dot--blue   { background: #3B82F6; }
.interp-guide__dot--green  { background: #059669; }
.interp-guide__dot--gold   { background: #D97706; }
.interp-guide__dot--red    { background: #B91C1C; }
.interp-guide__dot--purple { background: #9333EA; }
.interp-guide__dot--orange { background: #F97316; }

/* =========================================================
   Ghost reset button
   ========================================================= */
.btn-ghost {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-accent-ink);
  cursor: pointer;
  border-bottom: 1px dashed transparent;
  transition: border-color var(--transition-fast);
}

.btn-ghost:hover {
  border-bottom-color: var(--color-accent);
}

/* =========================================================
   Growth chart (compound-interest term page)
   ========================================================= */
.calc-chart {
  display: block;
  width: 100%;
  height: 200px;
  margin-top: 16px;
}

.qc-chart__line--alt {
  fill: none;
  stroke: #B45309;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 5 3;
}

.qc-chart__legend {
  font-size: 9px;
  fill: var(--color-text-faint);
  font-family: var(--font-mono);
}
