/**
 * css/tax-calculator.css
 * Town of Caledon — Property Tax Calculator
 * Loaded only on the calculator page via toc/tax-calculator library.
 */

/* ── Form layout ─────────────────────────────────────────────────────────── */
.calc-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 20px;
}

.calc-label {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--brand-text, #1d2b36);
  display: block;
}

.calc-req {
  color: #c0392b;
}

.calc-hint {
  font-size: 0.85rem;
  color: var(--brand-muted, #5b6770);
  margin-top: 4px;
  display: block;
}

/* Select wrapper */
.calc-select-wrap {
  position: relative;
  max-width: 480px;
  width: 100%;
}

.calc-select-wrap select {
  width: 100%;
  border: 2px solid #d0dae3 !important;
  border-radius: var(--radius) !important;
  min-height: 48px !important;
  padding: 12px 40px 12px 16px !important;
  font-size: 1rem;
  font-family: inherit;
  color: var(--brand-text, #1d2b36);
  background: #fff;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  box-sizing: border-box;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.calc-select-wrap select:focus {
  border-color: #000000 !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(0,0,0,0.05) !important;
}

.calc-chevron {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--brand-muted, #6b7280);
  display: flex;
  align-items: center;
}

/* Text input */
.calc-input {
  max-width: 480px;
  width: 100%;
  border: 2px solid #d0dae3 !important;
  border-radius: var(--radius) !important;
  min-height: 48px !important;
  padding: 12px 16px !important;
  font-size: 1rem;
  font-family: inherit;
  color: var(--brand-text, #1d2b36);
  box-sizing: border-box;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.calc-input:focus {
  border-color: #000000 !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(0,0,0,0.05) !important;
}

/* Actions row */
.calc-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
}

/* Error box */
.calc-error {
  margin-bottom: 16px;
  padding: 12px 16px;
  background: #fdf0ef;
  border: 1px solid #e8b4b0;
  border-radius: var(--radius);
  color: #c0392b;
  font-size: .9rem;
}

/* ── Results section ─────────────────────────────────────────────────────── */
.calc-divider {
  border: none;
  border-top: 1px solid var(--border, #e0e0e0);
  margin: 28px 0;
}

.calc-section-title {
  font-size: 1.8rem;
  color: var(--brand-blue-dark, #154d8e);
  margin: 0 0 12px;
  font-weight: 700;
}

.calc-intro {
  margin-bottom: 20px;
  font-size: 1rem;
  color: var(--brand-text, #1a1a1a);
}

.calc-muted {
  color: var(--brand-muted, #6b7280);
  font-size: .85rem;
  font-weight: normal;
}

/* ── Donut chart layout ──────────────────────────────────────────────────── */
.chart-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  margin: 24px 0 32px;
}

.chart-container {
  position: relative;
  width: 260px;
  height: 260px;
  flex-shrink: 0;
}

.chart-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 450px;
  width: 100%;
}

.legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  border-radius: 6px;
  transition: background 0.15s ease;
  font-size: .9rem;
  color: var(--brand-text, #1a1a1a);
  cursor: default;
}

.legend-label-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-color-box {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
}

.legend-value-group {
  text-align: right;
  font-weight: 500;
  white-space: nowrap;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .chart-layout {
    flex-direction: column;
    gap: 24px;
  }
  .chart-container {
    width: 220px;
    height: 220px;
  }
}

@media (max-width: 650px) {
  .calc-actions {
    flex-wrap: wrap;
  }
}

/* Large text size overrides (accessibility toggles) */
body.text-large .calc-actions,
body.text-xlarge .calc-actions {
  flex-wrap: wrap;
}