/* ==========================================================================
   Fastkava — B9 profit calculator / «Розрахуй прибуток»
   Centered kicker + heading, then a two-panel grid: three range sliders on the
   left, the live financial forecast + net profit + CTA on the right.
   ========================================================================== */

.fk-calc {
  position: relative;
  overflow: hidden;
  padding-block: clamp(64px, 9vw, 120px);

  /* Panel / control palette taken from the design (no token equivalent). */
  --calc-track: #8A7A6A;
  --calc-unit: #B8763F;

}
:root[data-theme="light"] .fk-calc {
  --calc-track: rgba(26,21,18,.24);
  --calc-unit: #A8541D;   /* darker than the dark-theme #B8763F — AA on white */

}

/*
 * Ambient circle in the top-left corner — static, painted, no filter.
 *
 * `closest-side` so it reaches full transparency at its own box edge: .fk-calc
 * has `overflow: hidden`, and a gradient still carrying alpha there would be
 * clipped into a hard rectangle. Anchored at 0,0 rather than overhanging, for
 * the same reason.
 */
.fk-calc__glow {
  position: absolute;
  z-index: 0;
  top: 0;
  left: 0;
  width: clamp(300px, 34vw, 520px);
  height: clamp(300px, 34vw, 520px);
  pointer-events: none;
  background: radial-gradient(circle closest-side at 50% 50%,
    rgba(251, 83, 0, .16) 0%,
    rgba(251, 83, 0, .128) 18%,
    rgba(251, 83, 0, .092) 34%,
    rgba(251, 83, 0, .056) 50%,
    rgba(251, 83, 0, .028) 64%,
    rgba(251, 83, 0, .012) 78%,
    rgba(251, 83, 0, .003) 90%,
    transparent 100%);
}
:root[data-theme="light"] .fk-calc__glow {
  background: radial-gradient(circle closest-side at 50% 50%,
    rgba(251, 83, 0, .10) 0%,
    rgba(251, 83, 0, .08) 18%,
    rgba(251, 83, 0, .058) 34%,
    rgba(251, 83, 0, .035) 50%,
    rgba(251, 83, 0, .018) 64%,
    rgba(251, 83, 0, .008) 78%,
    rgba(251, 83, 0, .002) 90%,
    transparent 100%);
}

.fk-calc__inner { position: relative; z-index: 1; }

/* ---- Head ---------------------------------------------------------------- */
.fk-calc__kicker {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin-bottom: 16px;
}
.fk-calc__kicker-line { flex: none; width: 34px; height: 2px; background: var(--fk-accent); }
.fk-calc__kicker-text {
  font-size: 13px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase;
  color: var(--fk-text-muted);
}
.fk-calc__title {
  margin: 0 auto clamp(28px, 4.6vw, 60px);
  max-width: 20ch;
  text-align: center;
  font-size: clamp(26px, 4.4vw, 52px);
  line-height: 1.1; font-weight: 800; letter-spacing: .5px;
  color: var(--fk-heading);
}

/* ---- Grid ---------------------------------------------------------------- */
.fk-calc__grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  align-items: stretch;
  gap: clamp(14px, 2.6vw, 40px);
}
/*
 * Same treatment as the B8 quiz panel: translucent glass over the animated
 * background plus a gradient hairline drawn with the mask trick, instead of the
 * old solid slabs and flat 1px border. Both panels share it — the quiz reads as
 * a single uniform surface, so the previous two-tone split is dropped.
 */
.fk-calc__panel {
  position: relative;
  box-sizing: border-box;
  min-width: 0;
  display: flex; flex-direction: column;
  border-radius: var(--fk-radius);
  background: rgba(18, 15, 12, .28);
  -webkit-backdrop-filter: blur(34px) saturate(1.5);
  backdrop-filter: blur(34px) saturate(1.5);
  box-shadow: 0 8px 32px rgba(0, 0, 0, .25);
}
:root[data-theme="light"] .fk-calc__panel {
  background: rgba(255, 255, 255, .55);
  box-shadow: 0 8px 32px rgba(26, 21, 18, .10);
}

/* Gradient hairline border (mask trick), matching the quiz panel. */
.fk-calc__panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: linear-gradient(150deg,
    rgba(251, 83, 0, .9),
    rgba(255, 255, 255, .3) 30%,
    rgba(251, 83, 0, .18) 55%,
    rgba(255, 160, 90, .85) 85%,
    rgba(255, 255, 255, .35));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box exclude, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
}
/* The white stops vanish on the light background — warm dark tints instead. */
:root[data-theme="light"] .fk-calc__panel::before {
  background: linear-gradient(150deg,
    rgba(251, 83, 0, .85),
    rgba(26, 21, 18, .16) 30%,
    rgba(251, 83, 0, .18) 55%,
    rgba(255, 122, 51, .75) 85%,
    rgba(26, 21, 18, .18));
}

.fk-calc__panel--controls {
  padding: clamp(24px, 4.8vw, 70px) clamp(18px, 2.8vw, 40px);
  gap: clamp(22px, 5.5vw, 80px);
}
.fk-calc__panel--result {
  padding: clamp(22px, 4.2vw, 60px) clamp(18px, 3.5vw, 50px);
}

/* ---- Controls ------------------------------------------------------------ */
.fk-calc__ctrl { display: flex; flex-direction: column; }
.fk-calc__ctrl-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: clamp(12px, 1.9vw, 28px);
}
.fk-calc__ctrl-label {
  font-size: clamp(13px, 1.25vw, 18px); font-weight: 800; letter-spacing: 1px;
  color: var(--fk-heading);
}
.fk-calc__ctrl-value {
  flex: none;
  font-size: clamp(22px, 2.8vw, 40px); font-weight: 800; line-height: 1;
  color: var(--fk-heading);
  font-variant-numeric: tabular-nums;
}
.fk-calc__ctrl-edges { display: flex; justify-content: space-between; gap: 12px; margin-top: clamp(8px, 1.1vw, 16px); }
.fk-calc__ctrl-edge {
  font-size: clamp(10px, .85vw, 12px); font-weight: 700; letter-spacing: 1px;
  color: var(--fk-text-dim);
}

/* Range slider — 2px rule with a 26px square accent thumb (per design). */
.fk-calc__range {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 26px;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
}
.fk-calc__range::-webkit-slider-runnable-track {
  height: 2px; border: none; border-radius: 0; background: var(--calc-track);
}
.fk-calc__range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 26px; height: 26px; margin-top: -12px;
  border: none; border-radius: 2px;
  background: var(--fk-accent);
  cursor: pointer;
}
.fk-calc__range::-moz-range-track {
  height: 2px; border: none; border-radius: 0; background: var(--calc-track);
}
.fk-calc__range::-moz-range-thumb {
  width: 26px; height: 26px;
  border: none; border-radius: 2px;
  background: var(--fk-accent);
  cursor: pointer;
}
.fk-calc__range:focus { outline: none; }
.fk-calc__range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px rgba(251,83,0,.35); }
.fk-calc__range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px rgba(251,83,0,.35); }

/* ---- Result -------------------------------------------------------------- */
.fk-calc__result-title {
  margin: 0 0 clamp(16px, 3.5vw, 50px);
  font-size: clamp(16px, 1.95vw, 28px); font-weight: 800; letter-spacing: .5px;
  color: var(--fk-heading);
}
.fk-calc__rows { margin: 0; padding: 0; display: flex; flex-direction: column; gap: clamp(10px, 2.2vw, 32px); }
.fk-calc__row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.fk-calc__row-label {
  margin: 0;
  min-width: 0; overflow-wrap: anywhere;
  font-size: clamp(13px, 1.32vw, 19px); font-weight: 500; line-height: 1.35;
  color: var(--fk-text);
}
.fk-calc__row-value {
  margin: 0;
  flex: none;
  font-size: clamp(16px, 1.67vw, 24px); font-weight: 800; white-space: nowrap;
  color: var(--fk-accent);
  font-variant-numeric: tabular-nums;
}
.fk-calc__unit { font-size: .63em; font-weight: 600; color: var(--calc-unit); }

.fk-calc__net { margin-top: auto; padding-top: clamp(18px, 3.5vw, 50px); }
.fk-calc__net-label {
  margin-bottom: 8px;
  font-size: clamp(12px, 1.05vw, 15px); font-weight: 800; letter-spacing: 1.5px;
  color: var(--fk-accent);
}
.fk-calc__net-value {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: clamp(8px, 1vw, 14px);
  margin-bottom: clamp(16px, 2.5vw, 36px);
}
.fk-calc__net-number {
  font-size: clamp(34px, 5.15vw, 74px); font-weight: 800; line-height: 1;
  color: var(--fk-heading);
  font-variant-numeric: tabular-nums;
}
.fk-calc__net-unit { font-size: clamp(20px, 2.1vw, 30px); font-weight: 800; color: var(--fk-accent); }

.fk-calc__cta {
  display: block; text-align: center;
  padding: clamp(13px, 1.4vw, 20px) 18px;
  border-radius: 6px;
  background: var(--fk-accent);
  color: #fff;
  font-size: clamp(14px, 1.11vw, 16px); font-weight: 700; letter-spacing: 2px;
  text-decoration: none;
  transition: background-color var(--fk-dur) var(--fk-ease);
}
.fk-calc__cta:hover,
.fk-calc__cta:focus-visible { background: var(--fk-accent-strong); color: #fff; }

/* ---- Responsive ---------------------------------------------------------- */
@media (max-width: 900px) {
  .fk-calc__grid { grid-template-columns: 1fr; gap: 16px; }
  .fk-calc__panel--controls { gap: 28px; }
  .fk-calc__ctrl-label { font-size: 15px; }
  .fk-calc__ctrl-value { font-size: 26px; }
  .fk-calc__result-title { font-size: 20px; }
  .fk-calc__row-label { font-size: 15px; }
  .fk-calc__row-value { font-size: 18px; }
  .fk-calc__net-number { font-size: 44px; }
  .fk-calc__net-unit { font-size: 26px; }
}
@media (max-width: 640px) {
  .fk-calc__grid { gap: 14px; }
  .fk-calc__kicker-line { width: 22px; }
  .fk-calc__kicker-text { font-size: 11px; letter-spacing: 2px; }
  .fk-calc__ctrl-label { font-size: 13px; letter-spacing: .5px; }
  .fk-calc__ctrl-value { font-size: 22px; }
  .fk-calc__result-title { font-size: 16px; }
  .fk-calc__row-label { font-size: 13px; }
  .fk-calc__row-value { font-size: 16px; }
  .fk-calc__net-number { font-size: 36px; }
  .fk-calc__net-unit { font-size: 20px; }
  .fk-calc__cta { letter-spacing: 1.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .fk-calc__cta { transition: none; }
}
