/* ============================================================
   Equipiva Affiliate — roi-calculator.css
   B2B Financial Performance Widget
   Palette: Trust Blue (#1a4a8a) + Savings Green (#1a7a3f)
   Append this file to public/css/style.css  OR  load separately.
   ============================================================ */

/* ── CSS Variables for ROI module ──────────────────────────── */
:root {
  --eq-roi-blue:       #1a4a8a;
  --eq-roi-blue-lt:    #e8f0fb;
  --eq-roi-blue-mid:   #3470c8;
  --eq-roi-green:      #1a7a3f;
  --eq-roi-green-lt:   #e8f6ee;
  --eq-roi-green-mid:  #28a55a;
  --eq-roi-amber:      #b86400;
  --eq-roi-amber-lt:   #fef5e7;
  --eq-roi-shadow:     0 4px 20px rgba(26,74,138,.10);
  --eq-roi-radius:     12px;
}

/* ════════════════════════════════════════════════════════════
   SECTION WRAPPER
   ════════════════════════════════════════════════════════════ */
.eqaff-roi-section {
  background: #fff;
  border: 1px solid #d4e1f7;
  border-radius: var(--eq-roi-radius);
  box-shadow: var(--eq-roi-shadow);
  padding: 28px 32px;
  margin-bottom: 24px;
  overflow: hidden;
}

/* ── Heading ─────────────────────────────────────────────── */
.eqaff-roi-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  color: var(--eq-roi-blue);
  margin: 0 0 6px;
}
.eqaff-roi-subheading {
  font-size: 14px;
  color: #555;
  margin-bottom: 22px;
  line-height: 1.5;
}

/* ════════════════════════════════════════════════════════════
   SUMMARY BAR (Annual Savings Badge + Payback + 5-yr)
   ════════════════════════════════════════════════════════════ */
.eqaff-roi-summary-bar {
  display: flex;
  align-items: stretch;
  background: var(--eq-roi-blue);
  border-radius: 10px;
  margin-bottom: 24px;
  overflow: hidden;
}
.eqaff-roi-summary-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px 16px;
  gap: 4px;
}
.eqaff-roi-summary-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: rgba(255,255,255,.7);
}
.eqaff-roi-summary-value {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
}
.eqaff-roi-savings-value {
  font-size: 28px;
  color: #4ceda0; /* bright green-teal on dark bg */
}
.eqaff-roi-summary-divider {
  width: 1px;
  background: rgba(255,255,255,.2);
  margin: 14px 0;
}

/* Pulse animation on value change */
@keyframes eqRoiPulse {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.08); }
  70%  { transform: scale(.97); }
  100% { transform: scale(1); }
}
.eqaff-roi-pulse {
  animation: eqRoiPulse .38s ease-out forwards;
}

/* ════════════════════════════════════════════════════════════
   BODY: Sliders LEFT | Breakdown RIGHT
   ════════════════════════════════════════════════════════════ */
.eqaff-roi-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

/* ── Sliders panel ──────────────────────────────────────────── */
.eqaff-roi-sliders {
  background: var(--eq-roi-blue-lt);
  border: 1px solid #c8d8f4;
  border-radius: 10px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.eqaff-roi-slider-group { display: flex; flex-direction: column; gap: 6px; }

.eqaff-roi-slider-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.eqaff-roi-slider-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--eq-roi-blue);
}
.eqaff-roi-slider-val {
  font-size: 14px;
  font-weight: 800;
  color: var(--eq-roi-blue);
  background: #fff;
  border: 1px solid #b8ccf0;
  border-radius: 6px;
  padding: 2px 9px;
  min-width: 80px;
  text-align: center;
}

/* ── Range slider (cross-browser) ──────────────────────────── */
.eqaff-roi-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 99px;
  background: linear-gradient(
    to right,
    var(--eq-roi-blue-mid) 0%,
    var(--eq-roi-blue-mid) var(--fill, 0%),
    #c8d8f4 var(--fill, 0%),
    #c8d8f4 100%
  );
  outline: none;
  cursor: pointer;
}
.eqaff-roi-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--eq-roi-blue);
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(26,74,138,.35);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.eqaff-roi-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--eq-roi-blue);
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(26,74,138,.35);
  cursor: pointer;
}
.eqaff-roi-slider:hover::-webkit-slider-thumb,
.eqaff-roi-slider:focus::-webkit-slider-thumb {
  transform: scale(1.2);
  box-shadow: 0 3px 12px rgba(26,74,138,.45);
}
.eqaff-roi-slider:focus {
  outline: 2px solid var(--eq-roi-blue-mid);
  outline-offset: 4px;
  border-radius: 4px;
}

.eqaff-roi-slider-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #7090bb;
}

/* ── Breakdown panel ────────────────────────────────────────── */
.eqaff-roi-breakdown {
  background: var(--eq-roi-green-lt);
  border: 1px solid #b4dfc6;
  border-radius: 10px;
  padding: 20px 22px;
}
.eqaff-roi-breakdown-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--eq-roi-green);
  margin-bottom: 12px;
}

/* ROI breakdown table */
.eqaff-roi-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.eqaff-roi-table tbody tr {
  border-bottom: 1px solid #cbeadb;
}
.eqaff-roi-table tbody tr:last-child { border-bottom: none; }

.eqaff-roi-row-label {
  padding: 9px 4px;
  color: #1a1a1a;
  line-height: 1.3;
}
.eqaff-roi-row-label small {
  display: block;
  font-size: 11px;
  color: #666;
  margin-top: 2px;
}
.eqaff-roi-icon { margin-right: 5px; }

.eqaff-roi-row-value {
  text-align: right;
  font-weight: 700;
  font-size: 15px;
  color: var(--eq-roi-green);
  white-space: nowrap;
  padding: 9px 4px;
}
.eqaff-roi-row-value--neg { color: var(--eq-red, #d0312d); }

.eqaff-roi-total-row {
  border-top: 2px solid var(--eq-roi-green) !important;
}
.eqaff-roi-total-cell {
  font-size: 18px;
  color: var(--eq-roi-green);
}

/* Payback strip */
.eqaff-roi-payback-strip {
  margin-top: 14px;
  background: #fff;
  border: 1px solid #b4dfc6;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: #333;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  line-height: 1.4;
}
.eqaff-roi-payback-icon { font-size: 16px; }
.eqaff-roi-payback-strip strong { color: var(--eq-roi-blue); }

/* ════════════════════════════════════════════════════════════
   DOWNLOAD BAR
   ════════════════════════════════════════════════════════════ */
.eqaff-roi-download-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 24px;
  background: linear-gradient(135deg, var(--eq-roi-blue-lt) 0%, #f0f7f4 100%);
  border: 1px dashed #9ab4d8;
  border-radius: 10px;
  padding: 18px 22px;
  flex-wrap: wrap;
}
.eqaff-roi-download-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.eqaff-roi-download-copy strong {
  font-size: 15px;
  color: var(--eq-roi-blue);
}
.eqaff-roi-download-copy span {
  font-size: 13px;
  color: #555;
  max-width: 460px;
  line-height: 1.4;
}
.eqaff-roi-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  background: var(--eq-roi-blue);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s, transform .15s, box-shadow .2s;
  box-shadow: 0 3px 12px rgba(26,74,138,.30);
}
.eqaff-roi-download-btn:hover {
  background: #163d73;
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(26,74,138,.38);
}
.eqaff-roi-download-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(26,74,138,.25);
}

/* ════════════════════════════════════════════════════════════
   ANNUAL SAVINGS BADGE (injected next to price block)
   ════════════════════════════════════════════════════════════ */
.eqaff-roi-price-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--eq-roi-green-lt);
  border: 1px solid #9ad4b6;
  border-radius: 6px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 700;
  color: var(--eq-roi-green);
  margin-left: 10px;
  vertical-align: middle;
  white-space: nowrap;
}
.eqaff-roi-price-badge svg { flex-shrink: 0; }

/* ════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════ */
@media (max-width: 880px) {
  .eqaff-roi-body { grid-template-columns: 1fr; }
  .eqaff-roi-section { padding: 20px 18px; }
}

@media (max-width: 600px) {
  .eqaff-roi-summary-bar { flex-direction: column; gap: 0; }
  .eqaff-roi-summary-divider { width: 100%; height: 1px; margin: 0 14px; }
  .eqaff-roi-summary-value { font-size: 20px; }
  .eqaff-roi-savings-value { font-size: 24px; }
  .eqaff-roi-download-bar { flex-direction: column; align-items: stretch; }
  .eqaff-roi-download-btn { justify-content: center; }
  .eqaff-roi-heading { font-size: 17px; }
}


/* ════════════════════════════════════════════════════════════
   TOTAL COST OF OWNERSHIP (TCO) — professional redesign
   ════════════════════════════════════════════════════════════ */

/* Outer wrapper */
.eqaff-tco-section {
  margin-top: 32px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

/* Header row: title + download button */
.eqaff-tco-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 28px 18px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.eqaff-tco-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 5px;
}

.eqaff-tco-heading-icon {
  color: #1a5fa8;
  flex-shrink: 0;
}

.eqaff-tco-pill {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 99px;
  background: #dbeafe;
  color: #1d4ed8;
  margin-left: 2px;
  letter-spacing: .02em;
}

.eqaff-tco-subheading {
  font-size: 13px;
  color: #64748b;
  margin: 0;
  max-width: 520px;
}

/* Download button */
.eqaff-tco-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  color: #1a5fa8;
  background: #fff;
  border: 1.5px solid #93c5fd;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .15s, border-color .15s;
}
.eqaff-tco-download-btn:hover  { background: #eff6ff; border-color: #3b82f6; }
.eqaff-tco-download-btn:active { opacity: .85; }
.eqaff-tco-download-btn:disabled { opacity: .5; cursor: default; }

/* KPI bar */
.eqaff-tco-kpi-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid #e2e8f0;
}

.eqaff-tco-kpi-card {
  padding: 20px 22px;
  border-right: 1px solid #e2e8f0;
  position: relative;
}
.eqaff-tco-kpi-card:last-child { border-right: none; }

/* accent stripe on top of each card */
.eqaff-tco-kpi-card::before {
  content: '';
  display: block;
  height: 3px;
  position: absolute;
  top: 0; left: 0; right: 0;
  border-radius: 0;
}
.eqaff-tco-kpi-card--cost::before    { background: #ef4444; }
.eqaff-tco-kpi-card--savings::before { background: #22c55e; }
.eqaff-tco-kpi-card--net::before     { background: #3b82f6; }

.eqaff-tco-kpi-card-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #64748b;
  margin-bottom: 6px;
}

.eqaff-tco-kpi-card-value {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 4px;
  color: #0f172a;
  transition: color .3s;
}

.eqaff-tco-kpi-card--cost    .eqaff-tco-kpi-card-value { color: #dc2626; }
.eqaff-tco-kpi-card--savings .eqaff-tco-kpi-card-value { color: #16a34a; }
.eqaff-tco-kpi-card--net     .eqaff-tco-kpi-card-value { color: #1d4ed8; }
.eqaff-tco-kpi-card--positive .eqaff-tco-kpi-card-value { color: #16a34a !important; }
.eqaff-tco-kpi-card--negative .eqaff-tco-kpi-card-value { color: #dc2626 !important; }

.eqaff-tco-kpi-card-sub {
  font-size: 12px;
  color: #94a3b8;
}

/* Breakdown table */
.eqaff-tco-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.eqaff-tco-table thead th {
  background: #f1f5f9;
  color: #334155;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: 10px 20px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

.eqaff-tco-th-right { text-align: right; }

.eqaff-tco-table tbody tr {
  border-bottom: 1px solid #f1f5f9;
  transition: background .12s;
}
.eqaff-tco-table tbody tr:last-child { border-bottom: none; }
.eqaff-tco-table tbody tr:hover { background: #f8fafc; }

.eqaff-tco-table td {
  padding: 13px 20px;
  vertical-align: middle;
  font-size: 14px;
  color: #1e293b;
}

/* Colored dot for one-time vs recurring */
.eqaff-tco-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 9px;
  vertical-align: middle;
  flex-shrink: 0;
}
.eqaff-tco-dot--once  { background: #3b82f6; }
.eqaff-tco-dot--recur { background: #f59e0b; }

/* secondary calculation note */
.eqaff-tco-calc-note {
  font-size: 12px;
  color: #94a3b8;
  margin-left: 6px;
  font-weight: 400;
}

/* Badge: one-time vs recurring */
.eqaff-tco-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  padding: 2px 9px;
  border-radius: 99px;
}
.eqaff-tco-badge--once  { background: #dbeafe; color: #1d4ed8; }
.eqaff-tco-badge--recur { background: #fef3c7; color: #92400e; }

.eqaff-tco-type-cell { white-space: nowrap; }

/* Amount column */
.eqaff-tco-amt-cell {
  text-align: right;
  font-weight: 600;
  white-space: nowrap;
  color: #334155;
}

/* Footer row */
.eqaff-tco-tfoot-row td {
  background: #0f172a;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  padding: 13px 20px;
}
.eqaff-tco-total-val {
  color: #fff !important;
  font-size: 16px;
}

/* Footnote */
.eqaff-tco-footnote {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 12px 20px;
  font-size: 12px;
  color: #64748b;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}
.eqaff-tco-footnote svg { flex-shrink: 0; color: #94a3b8; }

/* ── Responsive ── */
@media (max-width: 640px) {
  .eqaff-tco-header   { flex-direction: column; padding: 16px; gap: 12px; }
  .eqaff-tco-kpi-bar  { grid-template-columns: 1fr; }
  .eqaff-tco-kpi-card { border-right: none; border-bottom: 1px solid #e2e8f0; }
  .eqaff-tco-kpi-card:last-child { border-bottom: none; }
  .eqaff-tco-table td, .eqaff-tco-table th { padding: 10px 12px; font-size: 13px; }
  .eqaff-tco-download-btn { width: 100%; justify-content: center; }
}
