/* =============================================
   FINIT — Calculator UX Boost
   Addictive micro-interactions & viral features
   ============================================= */

/* ── Dynamic Result Headline ────────────────── */

.calc-result-headline {
  display: none;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.1rem;
  margin-bottom: 0.5rem;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand-navy, #071e36) 0%, #0d3258 100%);
  color: #fff;
  animation: headlineReveal 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.calc-result-headline.crh--visible {
  display: flex;
}

@keyframes headlineReveal {
  from { opacity: 0; transform: scale(0.94) translateY(4px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.crh-emoji {
  font-size: 1.5rem;
  flex-shrink: 0;
  line-height: 1;
}

.crh-text {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.35;
  font-family: var(--font-body, 'Heebo', sans-serif);
}

/* ── Real-Talk Context ──────────────────────── */

.calc-real-talk {
  display: none;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted, #7d9996);
  padding: 0.35rem 0 0.1rem;
  border-top: 1px solid rgba(7, 30, 54, 0.07);
  margin-top: 0.35rem;
  letter-spacing: 0.01em;
  line-height: 1.5;
}

.calc-real-talk.rlt--visible {
  display: block;
}

/* ── Multiplier Badge ───────────────────────── */

.calc-multiplier-badge {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: linear-gradient(135deg, rgba(15, 185, 168, 0.08) 0%, rgba(11, 107, 99, 0.12) 100%);
  border: 1px solid rgba(15, 185, 168, 0.28);
  border-radius: 10px;
  margin-top: 0.5rem;
  animation: badgeSlide 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.calc-multiplier-badge.mb--visible {
  display: flex;
}

@keyframes badgeSlide {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: translateX(0); }
}

.mb-times {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--brand-teal, #0b6b63);
  font-family: var(--font-body, 'Heebo', sans-serif);
  line-height: 1;
  flex-shrink: 0;
}

.mb-text {
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--text-secondary, #4a5a6a);
  line-height: 1.4;
}

.mb-text strong {
  color: var(--brand-teal, #0b6b63);
  display: block;
  font-size: 0.88rem;
}

/* ── Share Strip ────────────────────────────── */

.calc-share-strip {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
  background: rgba(7, 30, 54, 0.03);
  border: 1px solid rgba(7, 30, 54, 0.07);
  border-radius: 12px;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.share-strip-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted, #7d9996);
  flex-shrink: 0;
  font-family: var(--font-body, 'Heebo', sans-serif);
}

.share-strip-btns {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1.5px solid transparent;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: var(--font-body, 'Heebo', sans-serif);
  white-space: nowrap;
  min-height: 36px;
  -webkit-tap-highlight-color: transparent;
}

.share-btn--wa {
  background: #25D366;
  color: #fff;
  border-color: #25D366;
}

.share-btn--wa:hover {
  background: #1ebe5a;
  border-color: #1ebe5a;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
}

.share-btn--wa:active {
  transform: scale(0.96);
  box-shadow: none;
}

.share-btn--copy {
  background: transparent;
  color: var(--brand-navy, #071e36);
  border-color: rgba(7, 30, 54, 0.2);
}

.share-btn--copy:hover {
  background: rgba(7, 30, 54, 0.05);
  border-color: rgba(7, 30, 54, 0.35);
  transform: translateY(-1px);
}

.share-btn--copy:active,
.share-btn--copied {
  background: rgba(39, 174, 96, 0.08);
  border-color: rgba(39, 174, 96, 0.4);
  color: #1a6b35;
  transform: scale(0.96);
}

/* ── Cost of Delay Box ──────────────────────── */

.calc-cost-delay {
  display: none;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.9rem 1.1rem;
  margin-top: 0.75rem;
  background: rgba(243, 156, 18, 0.06);
  border: 1.5px solid rgba(243, 156, 18, 0.35);
  border-radius: 12px;
  animation: delayReveal 0.4s ease both;
}

.calc-cost-delay.cod--visible {
  display: flex;
}

@keyframes delayReveal {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.delay-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  line-height: 1.4;
  margin-top: 0.05rem;
}

.delay-content {
  flex: 1;
  min-width: 0;
}

.delay-main {
  font-size: 0.9rem;
  font-weight: 800;
  color: #7a4f00;
  line-height: 1.4;
  display: block;
  font-family: var(--font-body, 'Heebo', sans-serif);
}

.delay-sub {
  font-size: 0.8rem;
  font-weight: 600;
  color: #a06a00;
  line-height: 1.45;
  display: block;
  margin-top: 0.2rem;
}

/* ── Milestone Toast ────────────────────────── */

.calc-milestone-toast {
  position: fixed;
  bottom: -100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.4rem;
  background: linear-gradient(135deg, var(--brand-navy, #071e36) 0%, #0d3258 100%);
  color: #fff;
  border-radius: 999px;
  box-shadow: 0 8px 32px rgba(7, 30, 54, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
  font-family: var(--font-body, 'Heebo', sans-serif);
  font-weight: 700;
  font-size: 0.92rem;
  white-space: nowrap;
  transition: bottom 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  max-width: calc(100vw - 2rem);
  white-space: normal;
  text-align: center;
}

.calc-milestone-toast.milestone-toast--show {
  bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
}

/* On mobile push above bottom nav */
@media (max-width: 768px) {
  .calc-milestone-toast.milestone-toast--show {
    bottom: calc(70px + env(safe-area-inset-bottom, 0px));
  }
}

.milestone-emoji {
  font-size: 1.4rem;
  flex-shrink: 0;
  line-height: 1;
}

.milestone-text {
  line-height: 1.35;
}

/* ── Delay Input Pulse ──────────────────────── */
/* Flash effect on inputs when a scenario button is clicked */

@keyframes inputPop {
  0%   { background: inherit; }
  25%  { background: rgba(15, 185, 168, 0.12); }
  100% { background: inherit; }
}

.input-value--popped {
  animation: inputPop 0.6s ease forwards;
}

/* ── Big Number Reveal ──────────────────────── */
/* Enhanced first-reveal animation for the highlight result */

@keyframes bigNumberReveal {
  from {
    opacity: 0;
    transform: scale(0.7);
    filter: blur(4px);
  }
  60% {
    transform: scale(1.06);
    filter: blur(0);
  }
  to {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }
}

.result-value--first-reveal {
  animation: bigNumberReveal 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) both !important;
}

/* ── Progress toward goal ───────────────────── */

.calc-goal-bar {
  display: none;
  margin-top: 0.65rem;
}

.calc-goal-bar.cgb--visible {
  display: block;
}

.cgb-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary, #4a5a6a);
}

.cgb-pct {
  color: var(--brand-teal, #0b6b63);
  font-weight: 900;
}

.cgb-track {
  width: 100%;
  height: 8px;
  background: rgba(7, 30, 54, 0.07);
  border-radius: 999px;
  overflow: hidden;
}

.cgb-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-accent, #0fb9a8) 0%, var(--brand-teal, #0b6b63) 100%);
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-width: 4px;
}

/* ── Mobile ─────────────────────────────────── */

@media (max-width: 480px) {
  .calc-share-strip {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .share-strip-btns {
    width: 100%;
  }

  .share-btn {
    flex: 1;
    justify-content: center;
    min-height: 42px;
  }

  .calc-cost-delay {
    flex-direction: column;
    gap: 0.45rem;
  }

  .calc-milestone-toast {
    font-size: 0.88rem;
    padding: 0.75rem 1.1rem;
  }
}
