/* Calculator widget — used on /calculators/ web-app and standalone
 * landing pages. Brand-aligned: indigo focus rings, lime label on a
 * brand-indigo result panel with the lattice texture.
 * Loaded only when [fp_calculator] is used. */

.fp-calc {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 14px;
  padding: var(--s-5);
  margin: var(--s-5) 0;
}

/* Inside the calculators web-app, the parent .fp-cwa-calc already
 * provides the card surface + title, so the shortcode wrapper goes
 * flat to avoid the double-card look. */
.fp-cwa-calc__body .fp-calc {
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
}
.fp-cwa-calc__body .fp-calc__title { display: none; }

.fp-calc__title {
  font-family: var(--f-head);
  font-size: clamp(20px, 2.5vw, 24px);
  font-weight: 800;
  color: var(--c-ink);
  margin: 0 0 var(--s-4);
}

/* ── Input grid ──
 * align-items: end so all input boxes line up flush at the bottom
 * of the row even when one label wraps to 2-3 lines (e.g. "ANNUAL
 * CONTRIBUTION ($, MAX ~$4,150 SINGLE)"). Labels float above their
 * own input; inputs always stay aligned. */
.fp-calc__fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: var(--s-4) var(--s-3);
  margin-bottom: var(--s-2);
  align-items: end;
}
.fp-calc__field { display: flex; flex-direction: column; min-width: 0; }
.fp-calc__field label {
  font-family: var(--f-head);
  font-size: 11px; font-weight: 800;
  text-transform: uppercase;
  color: var(--c-muted);
  line-height: 1.35;
  margin-bottom: 6px;
}
.fp-calc__field input[type="number"] {
  padding: 12px 14px;
  border: 1.5px solid var(--c-border);
  border-radius: 10px;
  font-family: var(--f-head);
  font-size: 16px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--c-ink);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  -moz-appearance: textfield;
}
.fp-calc__field input[type="number"]::-webkit-outer-spin-button,
.fp-calc__field input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.fp-calc__field input[type="number"]:hover {
  border-color: rgba(79, 70, 229, 0.40);
}
.fp-calc__field input[type="number"]:focus {
  outline: none;
  border-color: var(--c-brand);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.18);
}

/* ── Result panel ── brand-indigo surface with lime accents and the
 * shared lattice texture so it feels like the rest of the brand. */
.fp-calc__result {
  position: relative;
  margin-top: var(--s-5);
  padding: var(--s-5) var(--s-5) var(--s-5) calc(var(--s-5) + 6px);
  background: var(--c-brand);
  border-radius: 14px;
  color: #fff;
  overflow: hidden;
  isolation: isolate;
}
.fp-calc__result::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: -1;
}
.fp-calc__result::after {
  content: "";
  position: absolute; left: 0; top: 14px; bottom: 14px;
  width: 4px;
  background: var(--c-accent);
  border-radius: 0 4px 4px 0;
}
.fp-calc__label {
  display: inline-block;
  font-family: var(--f-head);
  font-size: 11px; font-weight: 800;
  text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: 8px;
  position: relative;
}
.fp-calc__big {
  font-family: var(--f-head);
  font-size: clamp(28px, 4.6vw, 42px);
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  margin-bottom: 12px;
  position: relative;
}
.fp-calc__note {
  display: block;
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  line-height: 1.55;
  margin: 0;
  position: relative;
}
.fp-calc__note strong { color: var(--c-accent); font-weight: 800; }

/* ────────────────────────────────────────────────────────────────────
 * Compare scenarios — saved A vs B vs C side-by-side. Appears below
 * the calc widget. localStorage-backed (no auth required).
 * ──────────────────────────────────────────────────────────────────── */
.fp-calc-scenarios {
  margin-top: var(--s-5);
  padding-top: var(--s-4);
  border-top: 1px solid var(--c-border);
}
.fp-calc-scenarios__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
}
.fp-calc-scenarios__eye {
  font-family: var(--f-head);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--c-brand);
  margin: 0;
}
.fp-calc-scenarios__save {
  font-family: var(--f-head);
  font-size: 12px;
  font-weight: 800;
  color: var(--c-ink);
  background: var(--c-accent);
  border: 0;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s;
}
.fp-calc-scenarios__save:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px -4px rgba(199, 242, 48, 0.55);
}
.fp-calc-scenarios__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 10px;
}
.fp-calc-scenarios__empty {
  font-size: 12.5px;
  color: var(--c-muted);
  margin: 0;
  padding: 12px 14px;
  background: rgba(79, 70, 229, 0.04);
  border: 1px dashed rgba(79, 70, 229, 0.25);
  border-radius: 8px;
  text-align: center;
}
.fp-calc-scen {
  position: relative;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 10px;
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
}
.fp-calc-scen__remove {
  position: absolute;
  top: 6px; right: 8px;
  width: 22px; height: 22px;
  background: transparent;
  border: 0;
  font-size: 18px;
  color: var(--c-muted);
  cursor: pointer;
  line-height: 1;
  border-radius: 50%;
  transition: background .12s, color .12s;
}
.fp-calc-scen__remove:hover { background: rgba(0,0,0,0.06); color: var(--c-ink); }
.fp-calc-scen__label {
  font-family: var(--f-head);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--c-brand);
  background: rgba(79, 70, 229, 0.08);
  padding: 3px 10px;
  border-radius: 4px;
  width: max-content;
  margin: 0 0 10px;
}
.fp-calc-scen__inputs {
  font-size: 11px;
  color: var(--c-muted);
  line-height: 1.5;
  margin: 0 0 10px;
}
.fp-calc-scen__big {
  font-family: var(--f-head);
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 800;
  color: var(--c-brand);
  line-height: 1.1;
  margin: 0 0 8px;
  font-variant-numeric: tabular-nums;
}
.fp-calc-scen__note {
  font-size: 11.5px;
  color: var(--c-muted);
  line-height: 1.5;
  margin: 0 0 12px;
}
.fp-calc-scen__load {
  margin-top: auto;
  font-family: var(--f-head);
  font-size: 11px;
  font-weight: 800;
  color: var(--c-brand);
  background: transparent;
  border: 1px solid var(--c-border);
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.fp-calc-scen__load:hover {
  background: var(--c-brand);
  color: #fff;
  border-color: var(--c-brand);
}
