/* ==========================================================================
   Wiztra Chat — ROI calculator page
   Converted from src/pages/roi-calculator/page.tsx.

   The React original wrote an inline linear-gradient on each range input and an
   inline width on each breakdown bar. Here the geometry is expressed as CSS
   custom properties (--fill, --bar-w) whose defaults are declared below, so the
   page is correct with JavaScript disabled. js/roi.js updates the property
   values only; every rule that consumes them lives in this file.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Hero
   -------------------------------------------------------------------------- */

.roi-hero {
  padding-block: 112px 64px;
  background: var(--background-50);
  text-align: center;
}
@media (min-width: 1024px) { .roi-hero { padding-block: 144px 80px; } }

.roi-hero-inner {
  max-width: 900px;
  margin-inline: auto;
  padding-inline: 24px;
}
@media (min-width: 768px) { .roi-hero-inner { padding-inline: 40px; } }

.roi-hero-title {
  font-size: 36px;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  color: var(--foreground-950);
}
@media (min-width: 768px)  { .roi-hero-title { font-size: 48px; } }
@media (min-width: 1024px) { .roi-hero-title { font-size: 56px; } }

.roi-hero-sub {
  font-size: 16px;
  line-height: 1.65;
  color: var(--foreground-600);
  max-width: 600px;
  margin-inline: auto;
}
@media (min-width: 768px) { .roi-hero-sub { font-size: 18px; } }

/* --------------------------------------------------------------------------
   2. Calculator layout
   -------------------------------------------------------------------------- */

.roi-calc {
  padding-bottom: 40px;
  background: var(--background-50);
}
@media (min-width: 1024px) { .roi-calc { padding-bottom: 64px; } }

.roi-inner {
  max-width: 1100px;
  margin-inline: auto;
  padding-inline: 24px;
}
@media (min-width: 768px) { .roi-inner { padding-inline: 40px; } }

.roi-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
@media (min-width: 1024px) { .roi-grid { grid-template-columns: repeat(2, 1fr); } }

.roi-col-h2 {
  font-size: 32px;
  line-height: 1.15;
  text-align: center;
  color: var(--foreground-900);
  margin-bottom: 8px;
}
@media (min-width: 768px) { .roi-col-h2 { font-size: 44px; } }

.roi-inputs { display: flex; flex-direction: column; gap: 20px; }

.roi-results-col { display: block; }
@media (min-width: 1024px) {
  .roi-results-col {
    position: sticky;
    top: 100px;
    align-self: start;
  }
}

.roi-results-note {
  font-size: 15px;
  line-height: 1.65;
  text-align: center;
  color: var(--foreground-500);
  margin-bottom: 20px;
}

/* --------------------------------------------------------------------------
   3. Slider field
   -------------------------------------------------------------------------- */

.roi-field {
  padding: 20px;
  border-radius: 16px;
  border: 1px solid oklch(var(--background-200c) / 0.6);
  background: var(--background-50);
}
@media (min-width: 768px) { .roi-field { padding: 24px; } }

.roi-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.roi-field-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground-900);
}

.roi-field-value {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-600);
  white-space: nowrap;
}

/* Range input. --fill is the filled portion; its per-field default is set on
   the .roi-fill-* classes further down, and js/roi.js overwrites the value. */
.roi-range {
  width: 100%;
  height: 8px;
  margin-bottom: 8px;
  border-radius: 999px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background: linear-gradient(
    to right,
    var(--primary-500) 0%,
    var(--primary-500) var(--fill, 0%),
    oklch(var(--primary-200c)) var(--fill, 0%),
    oklch(var(--primary-200c)) 100%
  );
}

.roi-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px; height: 20px;
  border-radius: 999px;
  background: #fff;
  border: 2px solid var(--primary-500);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.roi-range::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 999px;
  background: #fff;
  border: 2px solid var(--primary-500);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.roi-range::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: transparent;
}

.roi-range-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 11px;
  color: var(--foreground-400);
}

.roi-field-help {
  font-size: 12px;
  line-height: 1.6;
  color: var(--foreground-500);
  margin-top: 8px;
}

/* Default fill positions, one per slider, matching the default values in the
   HTML. Keeps the track correct before any script runs. */
.roi-fill-chats      { --fill: 9.1%; }
.roi-fill-handletime { --fill: 24.1%; }
.roi-fill-wage       { --fill: 16.7%; }
.roi-fill-conversion { --fill: 12.8%; }
.roi-fill-dealsize   { --fill: 4.0%; }
.roi-fill-leads      { --fill: 8.2%; }

/* --------------------------------------------------------------------------
   4. Result cards
   -------------------------------------------------------------------------- */

.roi-res-pair {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.roi-res-single { margin-bottom: 16px; }

.roi-res-pair-last { margin-bottom: 24px; }

.roi-card {
  padding: 20px;
  border-radius: 16px;
  text-align: center;
  border: 1px solid oklch(var(--background-200c) / 0.6);
  background: var(--background-50);
}
@media (min-width: 768px) { .roi-card { padding: 24px; } }

.roi-card-accent {
  border-color: var(--primary-200);
  background: oklch(var(--primary-50c) / 0.6);
}

.roi-card-label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--foreground-500);
  margin-bottom: 8px;
}
.roi-card-accent .roi-card-label { color: var(--primary-700); }

.roi-card-value {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--foreground-950);
  line-height: 1.15;
}
@media (min-width: 768px) { .roi-card-value { font-size: 36px; } }
.roi-card-accent .roi-card-value { color: var(--primary-600); }

.roi-card-sub {
  font-size: 12px;
  color: var(--foreground-500);
  margin-top: 4px;
}

/* --------------------------------------------------------------------------
   5. Benefit breakdown bars
   -------------------------------------------------------------------------- */

.roi-breakdown {
  padding: 20px;
  border-radius: 16px;
  border: 1px solid oklch(var(--background-200c) / 0.6);
  background: var(--background-50);
}

.roi-breakdown-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--foreground-700);
  margin-bottom: 12px;
}

.roi-breakdown-list { display: flex; flex-direction: column; gap: 12px; }

.roi-bar-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
  font-size: 12px;
}
.roi-bar-head span:first-child { color: var(--foreground-600); }
.roi-bar-head span:last-child { font-weight: 600; color: var(--foreground-800); }

.roi-bar-track {
  height: 10px;
  border-radius: 999px;
  background: oklch(var(--background-200c) / 0.6);
  overflow: hidden;
}

.roi-bar-fill {
  height: 100%;
  border-radius: 999px;
  width: var(--bar-w, 0%);
  transition: width .5s ease;
}

/* Per-bar colour and no-JS default width, matching the default inputs. */
.roi-bar-support { background: var(--primary-400); --bar-w: 47.8%; }
.roi-bar-revenue { background: var(--accent-400); --bar-w: 52.2%; }
.roi-bar-cost    { background: var(--secondary-400); --bar-w: 10.2%; }

.roi-disclaimer {
  font-size: 12px;
  line-height: 1.6;
  color: var(--foreground-400);
  margin-top: 16px;
}
