/* ============================================================
   ClearChoiceRadar interactive calculators
   Shared, dependency-free design system. Modern "fintech" feel,
   fully responsive (inputs + live result panel side by side on
   desktop, stacked on mobile). Per-tool accent via .calc--{tool}.
   ============================================================ */

.calc {
  --calc-accent: #0ea5e9;
  --calc-accent-2: #0284c7;
  --calc-accent-soft: #e0f2fe;
  --calc-ink: #0f172a;
  --calc-muted: #64748b;
  --calc-line: #e2e8f0;
  --calc-bg: #ffffff;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--calc-ink);
  background: var(--calc-bg);
  border: 1px solid var(--calc-line);
  border-radius: 20px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 40px -16px rgba(15, 23, 42, 0.12);
  overflow: hidden;
  max-width: 920px;
  margin: 0 auto;
}

.calc--tax  { --calc-accent: #d97706; --calc-accent-2: #b45309; --calc-accent-soft: #fef3c7; }
.calc--debt { --calc-accent: #2563eb; --calc-accent-2: #1d4ed8; --calc-accent-soft: #dbeafe; }
.calc--solar{ --calc-accent: #0d9488; --calc-accent-2: #0f766e; --calc-accent-soft: #ccfbf1; }

.calc-head {
  padding: 22px 26px 18px;
  border-bottom: 1px solid var(--calc-line);
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.calc-head .calc-badge {
  flex: none;
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--calc-accent), var(--calc-accent-2));
  color: #fff;
}
.calc-head .calc-badge svg { width: 24px; height: 24px; }
.calc-title { font-size: 1.15rem; font-weight: 800; margin: 0 0 2px; letter-spacing: -0.01em; }
.calc-sub { font-size: 0.86rem; color: var(--calc-muted); margin: 0; line-height: 1.45; }

.calc-body {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 0;
}

/* ── Inputs ── */
.calc-inputs { padding: 24px 26px; display: flex; flex-direction: column; gap: 18px; }
.calc-field { display: flex; flex-direction: column; gap: 7px; }
.calc-field > label {
  font-size: 0.8rem; font-weight: 700; color: #334155;
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
}
.calc-field .calc-hint { font-size: 0.72rem; font-weight: 500; color: var(--calc-muted); }

.calc-money, .calc-num, .calc-select, .calc-pct {
  width: 100%;
  box-sizing: border-box;
  border: 1.5px solid var(--calc-line);
  border-radius: 11px;
  padding: 11px 13px;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--calc-ink);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
.calc-select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 34px; }
.calc-money:focus, .calc-num:focus, .calc-select:focus, .calc-pct:focus {
  outline: none;
  border-color: var(--calc-accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--calc-accent) 16%, transparent);
}
.calc-input-money { position: relative; }
.calc-input-money::before {
  content: "$"; position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  font-weight: 700; color: var(--calc-muted); pointer-events: none;
}
.calc-input-money .calc-money { padding-left: 26px; }
.calc-input-suffix { position: relative; }
.calc-input-suffix .calc-suffix {
  position: absolute; right: 13px; top: 50%; transform: translateY(-50%);
  font-weight: 700; color: var(--calc-muted); pointer-events: none; font-size: 0.85rem;
}

/* Range sliders */
.calc-range-row { display: flex; flex-direction: column; gap: 6px; }
.calc-range {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px; border-radius: 999px;
  background: var(--calc-line); outline: none; margin: 6px 0;
}
.calc-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: #fff; border: 3px solid var(--calc-accent);
  box-shadow: 0 2px 6px rgba(15,23,42,.18); cursor: pointer; transition: transform .1s;
}
.calc-range::-webkit-slider-thumb:active { transform: scale(1.12); }
.calc-range::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: #fff; border: 3px solid var(--calc-accent);
  box-shadow: 0 2px 6px rgba(15,23,42,.18); cursor: pointer;
}

.calc-check { display: flex; align-items: center; gap: 9px; font-size: 0.85rem; font-weight: 600; color: #334155; cursor: pointer; }
.calc-check input { width: 17px; height: 17px; accent-color: var(--calc-accent); cursor: pointer; }

/* ── Result panel ── */
.calc-result {
  background:
    radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--calc-accent) 10%, #fff) 0%, #fff 60%),
    var(--calc-accent-soft);
  border-left: 1px solid var(--calc-line);
  padding: 24px 26px;
  display: flex; flex-direction: column; gap: 16px;
}
.calc-result-label { font-size: 0.74rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--calc-accent-2); margin: 0; }
.calc-result-big {
  font-size: 2.5rem; font-weight: 800; line-height: 1; letter-spacing: -0.02em;
  color: var(--calc-ink); font-variant-numeric: tabular-nums;
}
.calc-result-note { font-size: 0.8rem; color: var(--calc-muted); margin: -6px 0 0; line-height: 1.45; }

/* Stacked breakdown bar */
.calc-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: #eef2f7; }
.calc-bar > span { height: 100%; transition: width .35s cubic-bezier(.4,0,.2,1); }
.calc-bar-s1 { background: var(--calc-ink); }
.calc-bar-s2 { background: var(--calc-accent); }
.calc-bar-s3 { background: color-mix(in srgb, var(--calc-accent) 45%, #fff); }

.calc-rows { display: flex; flex-direction: column; gap: 1px; background: var(--calc-line); border-radius: 12px; overflow: hidden; }
.calc-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 14px; background: #fff; font-size: 0.88rem; }
.calc-row .calc-row-key { color: #475569; display: flex; align-items: center; gap: 8px; font-weight: 600; }
.calc-row .calc-row-key .dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.calc-row .calc-row-val { font-weight: 800; color: var(--calc-ink); font-variant-numeric: tabular-nums; }
.calc-row--total { background: var(--calc-ink); }
.calc-row--total .calc-row-key, .calc-row--total .calc-row-val { color: #fff; }

.calc-flag { font-size: 0.78rem; color: #b45309; background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; padding: 9px 12px; line-height: 1.45; display: none; }
.calc-flag.show { display: block; }

/* ── Disclaimer ── */
.calc-foot { padding: 16px 26px 20px; border-top: 1px solid var(--calc-line); background: #f8fafc; }
.calc-foot p { font-size: 0.74rem; color: var(--calc-muted); line-height: 1.55; margin: 0; }
.calc-foot a { color: var(--calc-accent-2); }
.calc-foot .calc-foot-title { font-weight: 800; color: #475569; text-transform: uppercase; letter-spacing: .05em; font-size: 0.68rem; }

/* ── Responsive ── */
@media (max-width: 720px) {
  .calc-body { grid-template-columns: 1fr; }
  .calc-result { border-left: none; border-top: 1px solid var(--calc-line); }
  .calc-result-big { font-size: 2.1rem; }
  .calc-head, .calc-inputs, .calc-result, .calc-foot { padding-left: 18px; padding-right: 18px; }
}
