/* ============================================================
   RIVISIO — EHS ROI Calculator widget
   Requires: fonts.css, styles.css loaded before this file.
   Only contains widget-specific rules and overrides.
   ============================================================ */

/* ── CONTAINER ── */
#rv-roi {
  max-width: 980px;
  margin: 0 auto;
  padding: 8px;
}

/* styles.css sets h2 to Anxler 400, line-height 1.15 — adjust size and tighten line-height */
#rv-roi h2 {
  font-size: 1.7rem;
  line-height: 1.2;
}

/* styles.css label is focus-coloured at weight 700 — widget uses insight colour at 600 */
#rv-roi label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--insight);
  margin-bottom: 5px;
}

#rv-roi label .hint {
  display: block;
  font-weight: 400;
  color: var(--muted);
  font-size: 0.76rem;
  margin-top: 1px;
}

/* ── HEADER ── */
#rv-roi .rv-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
}

#rv-roi .rv-brand img {
  width: 230px;
  height: auto;
  max-width: 72%;
}

#rv-roi .rv-head {
  text-align: center;
  margin-bottom: 22px;
}

#rv-roi .rv-kicker {
  font-weight: 700;
  font-size: 0.74rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--signal);
  margin-bottom: 8px;
}

#rv-roi .rv-sub {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 8px;
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
}

/* ── LAYOUT ── */
#rv-roi .rv-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 20px;
}

/* ── RESPONSIVE ── */

/* Tablet landscape: grid stays 2-col but tighten up */
@media (max-width: 920px) {
  #rv-roi button {
    min-width: 140px;
    font-size: 0.82rem;
    padding: 9px 12px;
  }
  #rv-roi .rv-big {
    font-size: 2.5rem;
  }
}

/* Tablet portrait: stack to single column */
@media (max-width: 760px) {
  #rv-roi .rv-grid {
    grid-template-columns: 1fr;
  }
  #rv-roi .rv-card {
    padding: 18px;
  }
  #rv-roi .rv-res {
    position: static;
  }
}

/* Large mobile: scale down text and spacing */
@media (max-width: 560px) {
  #rv-roi {
    padding: 4px;
  }
  #rv-roi .rv-card {
    padding: 16px 14px;
    border-radius: 10px;
  }
  #rv-roi .rv-big {
    font-size: 2rem;
  }
  #rv-roi .rv-pill .v {
    font-size: 1.2rem;
  }
  #rv-roi .rv-pill .l {
    font-size: 0.65rem;
  }
  #rv-roi .rv-biglbl {
    font-size: 0.72rem;
  }
  #rv-roi button {
    min-width: 120px;
    font-size: 0.79rem;
    padding: 8px 10px;
  }
  #rv-roi .rv-mode-btns {
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
  }
  #rv-roi .rv-plan-btns {
    gap: 6px;
    margin-bottom: 14px;
  }
  #rv-roi .rv-line {
    font-size: 0.85rem;
    padding: 7px 0;
  }
  #rv-roi .rv-line .lv {
    font-size: 0.95rem;
  }
  #rv-roi .rv-line.tot .lv {
    font-size: 1.1rem;
  }
  #rv-roi .rv-roibar {
    gap: 8px;
    margin-top: 12px;
  }
  #rv-roi .rv-pill {
    padding: 9px 10px;
  }
  #rv-roi .rv-cta {
    margin-top: 14px;
    padding: 12px;
    font-size: 0.95rem;
  }
  #rv-roi .rv-sec {
    font-size: 0.74rem;
  }
  #rv-roi label {
    font-size: 0.8rem;
  }
  #rv-roi label .hint {
    font-size: 0.72rem;
  }
}

/* Small mobile: force buttons full-width, tighten further */
@media (max-width: 400px) {
  #rv-roi .rv-card {
    padding: 14px 12px;
    border-radius: 8px;
  }
  #rv-roi .rv-big {
    font-size: 1.75rem;
  }
  #rv-roi .rv-plan-btns button {
    flex: 1 1 100%;
    min-width: 0;
  }
  #rv-roi .rv-roibar {
    flex-direction: column;
    gap: 6px;
  }
  #rv-roi .rv-pill {
    flex: unset;
  }
}

/* ── CARDS ── */
#rv-roi .rv-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 10px 30px rgba(26, 32, 56, 0.05);
}

#rv-roi .rv-sec,
#rv-roi .rv-mode-lbl {
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--focus);
}

#rv-roi .rv-sec {
  margin: 6px 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

#rv-roi .rv-sec:not(:first-child) {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

#rv-roi .rv-mode-lbl {
  margin-bottom: 9px;
  display: block;
}

/* ── FORM FIELDS ── */
#rv-roi .rv-field {
  margin-bottom: 14px;
}

#rv-roi .rv-inwrap {
  position: relative;
  display: flex;
  align-items: center;
}

#rv-roi .rv-pre {
  position: absolute;
  left: 13px;
  color: var(--muted);
  font-size: 0.95rem;
  pointer-events: none;
}

#rv-roi .rv-suf {
  position: absolute;
  right: 14px;
  color: var(--muted);
  font-size: 0.8rem;
  pointer-events: none;
}

/* override global input padding */
#rv-roi input[type=number] {
  padding: 11px 13px 11px 13px;
}

/* extra left padding when a £ prefix is present */
#rv-roi .rv-pre + input[type=number] {
  padding-left: 25px;
}

#rv-roi input[type=number]::-webkit-outer-spin-button,
#rv-roi input[type=number]::-webkit-inner-spin-button {
  -webkit-appearance: inner-spin-button;
  opacity: 0.5;
}

/* ── MODE BUTTONS ── */
#rv-roi .rv-mode-btns {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap; /* always all-row or all-column, never partial wrap */
  margin-bottom: 20px;
}

#rv-roi .rv-mode-btns button {
  min-width: 0; /* allow shrinking below 160px so all 3 stay on one row */
}

#rv-roi .rv-plan-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

#rv-roi button {
  flex: 1;
  min-width: 160px;
  padding: 10px 16px;
  border-radius: 9px;
  border: 2px solid var(--perspective);
  background: transparent;
  color: var(--focus);
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
  text-align: center;
  line-height: 1.3;
}

#rv-roi button:hover {
  background: var(--focus);
  color: #fff;
  border-color: var(--focus);
}

#rv-roi button.active {
  background: var(--focus);
  color: #fff;
  border-color: var(--focus);
}

/* ── MODE SELECTOR ── */
/* override global select: signal border, tighter padding, heavier weight */
#rv-roi select {
  border-color: var(--signal);
  padding: 12px 13px;
  font-weight: 700;
  cursor: pointer;
}

#rv-roi select:focus {
  border-color: var(--signal-hover);
}

#rv-roi .rv-group[hidden] {
  display: none;
}

/* ── RESULTS PANEL ── */
#rv-roi .rv-right-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
}

#rv-roi .rv-res {
  background: linear-gradient(160deg, #263D92 0%, #1A2038 100%);
  color: #fff;
  border: none;
  position: sticky;
  top: var(--rv-top-offset, 16px);
  align-self: start;
  width: 100%;
  box-sizing: border-box;
}

#rv-roi .rv-res.rv-res--iframe {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  width: auto;
  align-self: unset;
}

#rv-roi .rv-res .rv-sec {
  color: rgba(255, 255, 255, 0.65);
}

#rv-roi .rv-res .rv-sec:not(:first-child) {
  border-top-color: rgba(255, 255, 255, 0.14);
}

#rv-roi .rv-hero {
  text-align: center;
  padding: 6px 0 4px;
}

#rv-roi .rv-big {
  font-family: var(--anxler-font);
  font-weight: 400;
  font-size: 2.9rem;
  line-height: 1;
  color: #fff;
}

#rv-roi .rv-biglbl {
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 7px;
}

#rv-roi .rv-roibar {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

#rv-roi .rv-pill {
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 11px;
  padding: 11px 14px;
  text-align: center;
  flex: 1;
}

#rv-roi .rv-pill .v {
  font-family: var(--anxler-font);
  font-weight: 400;
  font-size: 1.45rem;
  color: var(--signal);
}

#rv-roi .rv-pill .l {
  font-size: 0.7rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 3px;
}

#rv-roi .rv-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 9px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.14);
  font-size: 0.92rem;
}

#rv-roi .rv-line:last-child {
  border-bottom: none;
}

#rv-roi .rv-line .ll {
  color: rgba(255, 255, 255, 0.85);
}

#rv-roi .rv-line .lv {
  font-family: var(--anxler-font);
  font-weight: 400;
  font-size: 1.05rem;
  color: #fff;
}

#rv-roi .rv-line.cost .lv {
  color: #ffb98a;
}

#rv-roi .rv-line.tot {
  margin-top: 6px;
  padding-top: 13px;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  border-bottom: none;
}

#rv-roi .rv-line.tot .ll {
  font-weight: 700;
  color: #fff;
}

#rv-roi .rv-line.tot .lv {
  font-size: 1.25rem;
  color: var(--signal);
}

/* ── CTA BUTTON ── */
#rv-roi .rv-cta {
  display: block;
  width: 100%;
  margin-top: 18px;
  padding: 14px;
  border: none;
  border-radius: 10px;
  background: var(--signal);
  color: #fff;
  font-family: var(--anxler-font);
  font-weight: 400;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.18s;
  text-align: center;
  text-decoration: none;
}

#rv-roi .rv-cta:hover {
  background: var(--signal-hover);
}

/* ── PLAN INFO ── */
#rv-roi .rv-plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 6px;
}

#rv-roi .rv-tier {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  position: relative;
}

#rv-roi .rv-tier--featured {
  border-color: var(--focus);
}

#rv-roi .rv-tier-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--focus);
  margin-bottom: 4px;
}

#rv-roi .rv-tier-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--insight);
  margin-bottom: 4px;
}

#rv-roi .rv-tier-price {
  font-family: var(--anxler-font);
  font-weight: 400;
  font-size: 1.1rem;
  color: var(--focus);
  margin-bottom: 8px;
}

#rv-roi .rv-tier-price span {
  font-family: var(--body);
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--muted);
}

#rv-roi .rv-plan ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

#rv-roi .rv-plan ul li {
  font-size: 0.75rem;
  color: var(--muted);
  padding: 2px 0;
  padding-left: 12px;
  position: relative;
}

#rv-roi .rv-plan ul li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--focus);
  font-size: 0.7rem;
}

/* ── FOOTER NOTE ── */
#rv-roi .rv-foot {
  font-size: 0.74rem;
  color: var(--muted);
  margin-top: 18px;
  line-height: 1.55;
  text-align: center;
}

#rv-roi .rv-foot a {
  color: var(--perspective);
  text-decoration: none;
}

/* ── PLAN TOOLTIP ── */
#rv-tooltip {
  position: fixed;
  z-index: 9999;
  background: var(--insight);
  color: #fff;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.8rem;
  line-height: 1.7;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  max-width: 220px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

#rv-tooltip.visible {
  opacity: 1;
}

#rv-tooltip ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

#rv-tooltip ul li {
  padding: 1px 0 1px 14px;
  position: relative;
  color: rgba(255,255,255,0.9);
}

#rv-tooltip ul li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--signal);
  font-size: 0.7rem;
}
