/* SignalRadar referral page — interactive network, calculator and case studies */

:root {
  --network-gold: #facc15;
  --network-orange: #fb923c;
  --network-cyan: #22d3ee;
  --network-blue: #3b82f6;
  --network-violet: #a855f7;
}

html {
  scroll-behavior: smooth;
}

.page-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 80;
  height: 3px;
  pointer-events: none;
  background: rgba(2, 6, 23, 0.35);
}

.page-progress span {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--network-cyan), var(--network-blue), var(--network-violet));
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.85);
  will-change: transform;
}

.network-section {
  position: relative;
  isolation: isolate;
  overflow: clip;
}

.network-section::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: min(760px, 82vw);
  aspect-ratio: 1;
  right: -18%;
  top: 6%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.16), rgba(79, 70, 229, 0.08) 38%, transparent 70%);
  filter: blur(12px);
  pointer-events: none;
}

.network-layout {
  display: grid;
  grid-template-columns: minmax(250px, 310px) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.network-console,
.network-stage {
  position: relative;
  border: 1px solid rgba(125, 211, 252, 0.28);
  border-radius: 24px;
  background:
    linear-gradient(155deg, rgba(15, 23, 42, 0.97), rgba(2, 6, 23, 0.95)),
    rgba(2, 6, 23, 0.96);
  box-shadow:
    0 24px 72px rgba(2, 6, 23, 0.74),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.network-console {
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 16px;
  overflow: hidden;
}

.network-console::after {
  content: "";
  position: absolute;
  inset: -35% 42% 54% -20%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.2), transparent 68%);
  pointer-events: none;
}

.network-console > * {
  position: relative;
  z-index: 1;
}

.network-console__head,
.network-live,
.network-actions,
.network-level-filter,
.network-stage__legend,
.calc-range-head,
.calc-trend__head,
.calc-distribution__legend,
.reviews-actions {
  display: flex;
  align-items: center;
}

.network-console__head {
  justify-content: space-between;
  gap: 8px;
}

.network-live {
  gap: 7px;
  color: #bbf7d0;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.network-live i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.62);
  animation: networkLive 1.8s ease-out infinite;
}

.network-console__scale {
  color: var(--text-muted);
  font-size: 0.68rem;
  text-align: right;
}

.network-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.network-kpi {
  min-width: 0;
  padding: 9px 8px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.58);
}

.network-kpi span {
  display: block;
  overflow: hidden;
  margin-bottom: 3px;
  color: var(--text-muted);
  font-size: 0.62rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.network-kpi strong {
  display: block;
  overflow: hidden;
  color: var(--network-cyan);
  font-size: clamp(0.82rem, 1.4vw, 1rem);
  text-overflow: ellipsis;
}

.network-kpi--gold strong {
  color: var(--network-gold);
}

.network-level-filter {
  flex-wrap: wrap;
  gap: 6px;
}

.network-filter,
.network-action,
.calc-preset,
.reviews-action {
  min-height: 36px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.76);
  color: var(--text-muted);
  font: inherit;
  font-size: 0.72rem;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.network-filter {
  flex: 1 1 calc(50% - 4px);
  padding: 6px 8px;
}

.network-filter:hover,
.network-filter:focus-visible,
.network-filter.is-active,
.calc-preset:hover,
.calc-preset:focus-visible,
.calc-preset.is-active,
.reviews-action:hover,
.reviews-action:focus-visible {
  border-color: rgba(34, 211, 238, 0.72);
  background: rgba(8, 47, 73, 0.62);
  color: #e0f2fe;
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.12), 0 8px 24px rgba(8, 145, 178, 0.16);
}

.network-filter:active,
.network-action:active,
.calc-preset:active,
.reviews-action:active {
  transform: scale(0.97);
}

.network-actions {
  gap: 7px;
}

.network-action {
  flex: 1 1 0;
  padding: 7px 10px;
  color: var(--text-main);
}

.network-action:hover,
.network-action:focus-visible {
  border-color: rgba(250, 204, 21, 0.65);
  color: #fef08a;
}

.network-detail {
  min-height: 132px;
  margin-top: auto;
  padding: 13px;
  border: 1px solid rgba(34, 211, 238, 0.34);
  border-radius: 17px;
  background:
    radial-gradient(circle at 0 0, rgba(34, 211, 238, 0.15), transparent 65%),
    rgba(2, 6, 23, 0.76);
}

.network-detail__eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--network-cyan);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.network-detail strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text-main);
  font-size: 0.9rem;
}

.network-detail p {
  color: var(--text-muted);
  font-size: 0.76rem;
  line-height: 1.55;
}

.network-stage-wrap {
  min-width: 0;
}

.network-stage {
  min-height: 100%;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 50%, rgba(14, 116, 144, 0.18), transparent 28%),
    linear-gradient(rgba(34, 211, 238, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.035) 1px, transparent 1px),
    rgba(2, 6, 23, 0.96);
  background-size: auto, 32px 32px, 32px 32px, auto;
}

.network-stage::before,
.network-stage::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.network-stage::before {
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(34, 211, 238, 0.055) 47%, transparent 64%);
  transform: translateX(-100%);
  animation: networkScan 7s ease-in-out infinite;
}

.network-stage::after {
  inset: 12px;
  border: 1px solid rgba(34, 211, 238, 0.09);
  border-radius: 18px;
}

#refNetworkSvg {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  min-height: 470px;
  aspect-ratio: 1000 / 650;
  overflow: visible;
  touch-action: pan-y;
}

.network-ring {
  fill: none;
  stroke: rgba(125, 211, 252, 0.16);
  stroke-width: 1.2;
  stroke-dasharray: 5 10;
  transform-origin: center;
  animation: networkRing 28s linear infinite;
}

.network-ring:nth-of-type(even) {
  animation-direction: reverse;
  animation-duration: 34s;
}

.network-edge {
  fill: none;
  stroke: url(#edgeGradient);
  stroke-width: 1.45;
  stroke-linecap: round;
  opacity: 0.64;
  vector-effect: non-scaling-stroke;
  transition: opacity 220ms ease, stroke-width 220ms ease;
}

.network-edge-pulse {
  fill: none;
  stroke: rgba(103, 232, 249, 0.84);
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-dasharray: 2 14;
  vector-effect: non-scaling-stroke;
  animation: networkLinkFlow 2.2s linear infinite;
}

.network-money {
  fill: var(--network-gold);
  filter: url(#moneyGlow);
}

.network-node {
  cursor: pointer;
  outline: none;
  transition: opacity 220ms ease;
}

.network-node .network-node__halo {
  fill: rgba(34, 211, 238, 0.08);
  stroke: rgba(34, 211, 238, 0.18);
  stroke-width: 1;
  transform-box: fill-box;
  transform-origin: center;
  animation: networkNodeHalo 2.8s ease-in-out infinite;
}

.network-node .network-node__core {
  fill: rgba(3, 17, 31, 0.96);
  stroke: var(--node-color, var(--network-cyan));
  stroke-width: 2;
  filter: url(#nodeGlow);
  transition: fill 180ms ease, stroke-width 180ms ease;
}

.network-node:hover .network-node__core,
.network-node:focus .network-node__core,
.network-node.is-selected .network-node__core {
  fill: rgba(14, 116, 144, 0.38);
  stroke-width: 3.4;
}

.network-node__label {
  fill: #e2e8f0;
  font-family: "Inter", sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-anchor: middle;
  pointer-events: none;
}

.network-node__value {
  fill: #94a3b8;
  font-family: "Inter", sans-serif;
  font-size: 8.5px;
  text-anchor: middle;
  pointer-events: none;
}

.network-node--root .network-node__core {
  fill: rgba(8, 47, 73, 0.98);
  stroke: #fef08a;
  stroke-width: 3;
  filter: url(#rootGlow);
}

.network-node--root .network-node__halo {
  fill: rgba(250, 204, 21, 0.1);
  stroke: rgba(250, 204, 21, 0.42);
  animation-duration: 1.9s;
}

.network-node--root .network-node__label {
  fill: #fef9c3;
  font-size: 13px;
}

.network-node--root .network-node__value {
  fill: #facc15;
  font-size: 10px;
}

.network-group.is-dimmed {
  opacity: 0.12;
}

.network-group.is-highlighted .network-edge,
.network-group.is-highlighted .network-edge-pulse {
  opacity: 1;
  stroke-width: 2.8;
}

.network-stage.is-paused *,
.low-power .network-stage * {
  animation-play-state: paused !important;
}

.network-stage__legend {
  position: absolute;
  z-index: 3;
  right: 15px;
  bottom: 13px;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 12px;
  padding: 7px 10px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.78);
  color: var(--text-muted);
  font-size: 0.64rem;
  backdrop-filter: blur(8px);
}

.network-stage__legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-link,
.legend-money {
  display: inline-block;
  flex: 0 0 auto;
}

.legend-link {
  width: 20px;
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--network-cyan) 0 3px, transparent 3px 6px);
}

.legend-money {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--network-gold);
  box-shadow: 0 0 8px rgba(250, 204, 21, 0.8);
}

.network-mobile-hint {
  display: none;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.72rem;
  text-align: center;
}

/* Enhanced calculator */

.calc-presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: 4px 0 13px;
}

.calc-presets__label {
  margin-right: 2px;
  color: var(--text-muted);
  font-size: 0.74rem;
}

.calc-preset {
  padding: 7px 11px;
}

.calc-range-row {
  margin: 13px 0 0;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 15px;
  background: rgba(2, 6, 23, 0.48);
}

.calc-range-head {
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
  color: var(--text-main);
  font-size: 0.8rem;
}

.calc-range-head output {
  flex: 0 0 auto;
  padding: 3px 8px;
  border: 1px solid rgba(34, 211, 238, 0.36);
  border-radius: 999px;
  color: var(--network-cyan);
  font-size: 0.72rem;
  font-weight: 700;
}

.calc-range-row input[type="range"] {
  width: 100%;
  height: 5px;
  border-radius: 999px;
  outline: none;
  accent-color: var(--network-cyan);
  cursor: pointer;
}

.calc-range-row p {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.7rem;
  line-height: 1.45;
}

.calc-distribution {
  position: relative;
  margin: 11px 0;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.44);
}

.calc-distribution__bar {
  display: flex;
  width: 100%;
  height: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
}

.calc-share {
  display: block;
  width: 0;
  min-width: 0;
  height: 100%;
  transition: width 460ms cubic-bezier(0.22, 1, 0.36, 1);
}

.calc-share--l1 { background: linear-gradient(90deg, #06b6d4, #22d3ee); }
.calc-share--l2 { background: linear-gradient(90deg, #3b82f6, #6366f1); }
.calc-share--l3 { background: linear-gradient(90deg, #8b5cf6, #d946ef); }

.calc-distribution__legend {
  flex-wrap: wrap;
  gap: 7px 13px;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.68rem;
}

.calc-distribution__legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.calc-distribution__legend b {
  color: var(--text-main);
}

.share-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.share-dot--l1 { background: #22d3ee; }
.share-dot--l2 { background: #6366f1; }
.share-dot--l3 { background: #d946ef; }

.calc-projection-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 9px;
}

.calc-projection-card {
  padding: 10px;
  border: 1px solid rgba(34, 211, 238, 0.27);
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.58);
}

.calc-projection-card span,
.calc-projection-card small {
  display: block;
  color: var(--text-muted);
  font-size: 0.66rem;
}

.calc-projection-card strong {
  display: block;
  margin: 4px 0 2px;
  color: var(--network-cyan);
  font-size: 1.04rem;
}

.calc-projection-card--gold {
  border-color: rgba(250, 204, 21, 0.28);
}

.calc-projection-card--gold strong {
  color: var(--network-gold);
}

.calc-trend {
  position: relative;
  margin-top: 9px;
  padding: 10px 10px 4px;
  border: 1px solid rgba(125, 211, 252, 0.24);
  border-radius: 15px;
  background:
    linear-gradient(rgba(34, 211, 238, 0.04) 1px, transparent 1px),
    rgba(2, 6, 23, 0.55);
  background-size: 100% 26px;
}

.calc-trend__head {
  justify-content: space-between;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.7rem;
}

.calc-trend__head strong {
  color: var(--network-gold);
  font-size: 0.78rem;
}

#calcTrendSvg {
  display: block;
  width: 100%;
  height: 96px;
  overflow: visible;
}

.calc-trend-line {
  fill: none;
  stroke: #22d3ee;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 6px rgba(34, 211, 238, 0.56));
  stroke-dasharray: 720;
  stroke-dashoffset: 720;
  animation: trendDraw 1s ease-out forwards;
}

.calc-trend-area {
  fill: url(#trendFill);
}

.calc-trend-point {
  fill: #fef08a;
  stroke: #facc15;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.calc-disclaimer {
  position: relative;
  margin-top: 9px;
  padding: 9px 10px;
  border-left: 2px solid rgba(250, 204, 21, 0.58);
  border-radius: 8px;
  background: rgba(113, 63, 18, 0.12);
  color: #cbd5e1;
  font-size: 0.68rem;
  line-height: 1.5;
}

/* Interactive modelled cases */

.reviews-toolbar {
  align-items: center;
}

.theme-chip {
  min-height: 34px;
  cursor: pointer;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.theme-chip:hover,
.theme-chip:focus-visible,
.theme-chip.is-active {
  transform: translateY(-1px);
  border-color: rgba(34, 211, 238, 0.72);
  background: rgba(8, 47, 73, 0.68);
  color: #e0f2fe;
}

.reviews-actions {
  flex-wrap: wrap;
  gap: 6px;
}

.reviews-action {
  min-width: 38px;
  padding: 6px 10px;
}

.reviews-action--shuffle {
  padding-inline: 13px;
}

.testimonials-track {
  scroll-snap-type: x mandatory;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

.testimonials-track.is-rebuilding .testimonial-card {
  opacity: 0;
  transform: translateY(12px) scale(0.98);
}

.testimonial-card {
  width: min(340px, calc(100vw - 46px));
  min-width: min(340px, calc(100vw - 46px));
  max-width: 340px;
  scroll-snap-align: start;
  transition: opacity 260ms ease, transform 260ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.testimonial-card:hover {
  transform: translateY(-4px);
  border-color: rgba(34, 211, 238, 0.48);
  box-shadow: 0 22px 54px rgba(2, 6, 23, 0.85), 0 0 26px rgba(34, 211, 238, 0.12);
}

.testimonial-demo-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 8px;
  padding: 4px 8px;
  border: 1px solid rgba(250, 204, 21, 0.34);
  border-radius: 999px;
  background: rgba(113, 63, 18, 0.16);
  color: #fef08a;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.testimonial-card .testimonial-name {
  line-height: 1.35;
}

.testimonial-card .testimonial-text {
  line-height: 1.6;
}

.testimonial-structure {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin-top: 8px;
}

.testimonial-structure span {
  padding: 6px 5px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.54);
  color: var(--text-muted);
  font-size: 0.62rem;
  text-align: center;
}

.testimonial-structure b {
  display: block;
  margin-bottom: 2px;
  color: var(--text-main);
  font-size: 0.76rem;
}

.testimonial-income {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(148, 163, 184, 0.3);
  color: var(--text-muted);
  font-size: 0.67rem;
}

.testimonial-income strong {
  color: var(--network-gold);
  font-size: 0.9rem;
}

.testimonials-empty {
  width: 100%;
  padding: 28px;
  border: 1px dashed rgba(148, 163, 184, 0.4);
  border-radius: 18px;
  color: var(--text-muted);
  text-align: center;
}

@keyframes networkLive {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

@keyframes networkScan {
  0%, 18% { transform: translateX(-100%); }
  70%, 100% { transform: translateX(100%); }
}

@keyframes networkRing {
  to { transform: rotate(360deg); }
}

@keyframes networkLinkFlow {
  to { stroke-dashoffset: -32; }
}

@keyframes networkNodeHalo {
  0%, 100% { transform: scale(0.92); opacity: 0.55; }
  50% { transform: scale(1.12); opacity: 1; }
}

@keyframes trendDraw {
  to { stroke-dashoffset: 0; }
}

@media (hover: hover) and (pointer: fine) {
  .network-console,
  .calc-panel,
  .calc-results {
    transform: perspective(1000px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
    transform-style: preserve-3d;
    transition: transform 180ms ease-out;
  }
}

@media (max-width: 900px) {
  .network-layout {
    grid-template-columns: 1fr;
  }

  .network-console {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .network-console__head,
  .network-kpis,
  .network-detail {
    grid-column: 1 / -1;
  }

  .network-detail {
    min-height: 0;
  }

  #refNetworkSvg {
    min-height: 430px;
  }
}

@media (max-width: 640px) {
  .network-section::before {
    right: -42%;
  }

  .network-console {
    display: flex;
    padding: 13px;
    border-radius: 19px;
  }

  .network-stage {
    border-radius: 19px;
  }

  #refNetworkSvg {
    min-height: 570px;
    aspect-ratio: 380 / 680;
  }

  .network-stage__legend {
    right: 10px;
    bottom: 9px;
    left: 10px;
    justify-content: center;
    border-radius: 13px;
  }

  .network-mobile-hint {
    display: block;
  }

  .calc-presets {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calc-presets__label {
    grid-column: 1 / -1;
  }

  .calc-preset {
    width: 100%;
    min-height: 40px;
  }

  .calc-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .calc-input-wrap {
    width: 100%;
  }

  .calc-input-wrap input[type="number"] {
    width: 92px;
    min-height: 40px;
  }

  .calc-projection-grid {
    grid-template-columns: 1fr;
  }

  .reviews-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .reviews-count {
    align-self: flex-start;
  }

  .reviews-themes,
  .reviews-actions {
    width: 100%;
  }

  .theme-chip {
    flex: 1 1 calc(50% - 5px);
  }

  .reviews-action {
    flex: 1 1 auto;
    min-height: 40px;
  }

  .testimonial-card {
    min-width: calc(100vw - 44px);
  }
}

@media (max-width: 380px) {
  .network-kpis {
    grid-template-columns: 1fr;
  }

  .network-kpi {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .network-kpi span {
    margin: 0;
  }

  .network-action {
    min-height: 42px;
  }

  .calc-presets {
    grid-template-columns: 1fr;
  }

  .calc-presets__label {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .network-stage *,
  .network-live i,
  .calc-trend-line {
    animation: none !important;
  }

  .testimonial-card,
  .calc-share,
  .network-node,
  .network-edge {
    transition: none !important;
  }
}

.low-power .network-stage::before,
.low-power .network-ring,
.low-power .network-edge-pulse,
.low-power .network-money,
.low-power .network-node__halo {
  display: none;
}

.low-power .network-stage,
.low-power .network-console {
  box-shadow: 0 12px 30px rgba(2, 6, 23, 0.58);
}
