/* ── PHASE 5: CALCULATOR UPGRADE ── */

/* Receipt slide-in — only active after JS adds cu-active */
.cu-active #p3 {
  animation: none !important;
  transform: translateY(24px);
  opacity: 0;
}

.cu-active #p3.rr {
  transform: translateY(0);
  opacity: 1;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Step-2 live preview strip */
.calc-preview {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(201, 149, 61, 0.06);
  border: 1px dashed rgba(201, 149, 61, 0.28);
  border-radius: 6px;
}

.cp-lbl {
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}

.cp-val {
  font-family: 'Courier New', monospace;
  font-size: 15px;
  font-weight: 700;
  color: var(--gold-c);
}

/* Rate comparison bars */
#calcRateBars {
  margin: 12px 0 16px;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--calc-border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rb-item { display: flex; align-items: center; gap: 10px; }

.rb-lbl {
  width: 118px;
  font-size: 11px;
  font-family: 'Courier New', monospace;
  color: var(--text-muted);
  flex-shrink: 0;
}

.rb-track {
  flex: 1;
  height: 7px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.rb-fill {
  height: 100%;
  border-radius: 4px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.rb-fill.curr  { background: rgba(163, 56, 40, 0.72); }
.rb-fill.crane { background: var(--gold-c); }

.rb-pct {
  width: 42px;
  text-align: right;
  font-size: 11px;
  font-family: 'Courier New', monospace;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Savings checkmark stamp */
.sav-bar { position: relative; }

.sav-check {
  position: absolute;
  bottom: 20px;
  right: 20px;
  font-size: 20px;
  font-weight: 700;
  color: #2e9e5b;
  transform: scale(0.5);
  opacity: 0;
  transform-origin: center;
  transition: transform 200ms cubic-bezier(0.34, 1.26, 0.64, 1),
              opacity 150ms cubic-bezier(0.16, 1, 0.3, 1);
}

.sav-check.stamped { transform: scale(1); opacity: 1; }

/* Annual projection fade */
.sav-ann-wrap { opacity: 0; transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.sav-ann-wrap.visible { opacity: 1; }

/* Receipt line items — gate on cu-active so graceful without JS */
.cu-active .receipt-line {
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.cu-active .receipt-line.printed {
  opacity: 1;
  transform: translateY(0);
}

/* Receipt card dark styling */
.cu-active .bdwn {
  background: #1c1410;
  border-color: rgba(201, 149, 61, 0.14);
  position: relative;
  overflow: hidden;
}

.cu-active .bdwn::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
}

.cu-active .bdwn-hd { color: rgba(201, 149, 61, 0.8); font-weight: 700; }

.cu-active .bd-row { border-bottom-style: dashed; border-bottom-color: rgba(201, 149, 61, 0.12); }

.cu-active .bd-row .l {
  font-family: 'Courier New', monospace;
  font-size: 11.5px;
  font-weight: 700;
  color: rgba(244, 230, 211, 0.88);
}

.cu-active .bd-row .v {
  font-family: 'Courier New', monospace;
  font-size: 11.5px;
  font-weight: 700;
  color: rgba(244, 230, 211, 0.9);
}

.cu-active .bd-row .v.r { color: #e07070; }
.cu-active .bd-row .v.g { color: #c9953d; }
.cu-active .bd-row .v.o { color: #c9953d; }

/* Results boxes: sequential reveal — current rate lands first, then Crane */
.cu-active #p3 .rbox {
  opacity: 0;
  transform: translateY(10px);
}

.cu-active #p3.rr .rbox.bad {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cu-active #p3.rr .rbox.good {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1) 0.16s,
              transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) 0.16s;
}

/* Savings bar entrance — fades in before the counter starts */
.cu-active .sav-bar {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1) 0.15s,
              transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) 0.15s;
}

.cu-active #p3.rr .sav-bar {
  opacity: 1;
  transform: translateY(0);
}

/* Reduced motion: instant reveal, no sequencing */
@media (prefers-reduced-motion: reduce) {
  .cu-active #p3 { transform: none !important; opacity: 1 !important; }
  .cu-active .receipt-line { opacity: 1 !important; transform: none !important; transition: none !important; }
  .sav-check { transform: scale(1) !important; opacity: 1 !important; transition: none !important; }
  .sav-ann-wrap { opacity: 1 !important; transition: none !important; }
  .rb-fill { transition: none !important; }
  .cu-active .sav-bar { opacity: 1 !important; transform: none !important; transition: none !important; }
  .cu-active #p3 .rbox { opacity: 1 !important; transform: none !important; transition: none !important; }
}
