/* =========================================================
   "Grow Your Canopy" — widget, nav pill, finisher overlay,
   leaf animations. Loaded after hub.css.
   ========================================================= */

/* leaf pop-in */
.cl-leaf { transform-box: fill-box; transform-origin: center; }
@keyframes cl-pop { 0% { transform: scale(0); opacity: 0; } 60% { transform: scale(1.18); } 100% { transform: scale(1); opacity: 1; } }
.cl-new { animation: cl-pop 0.55s cubic-bezier(0.2,0.7,0.2,1) both; }

/* ---------------- Hero canopy card ---------------- */
.canopy-card {
  --acc: #12B7AD; --acc-tint: #E3F7F5;
  background: var(--cc-white); border: 1px solid var(--border-1);
  border-radius: var(--radius-2xl); box-shadow: var(--shadow-lg);
  padding: 26px 28px 24px; text-align: center; width: 340px; max-width: 100%;
}
.canopy-card .ctree { width: 232px; height: 232px; margin: 0 auto 6px; position: relative; }
.canopy-tier { font-size: 11px; font-weight: var(--fw-bold); letter-spacing: 0.12em; text-transform: uppercase; color: var(--acc); }
.canopy-count { font-size: 26px; font-weight: var(--fw-extrabold); letter-spacing: -0.02em; color: var(--fg-1); margin: 4px 0 2px; }
.canopy-count b { color: var(--acc); }
.canopy-sub { font-size: 13px; color: var(--fg-3); margin-bottom: 16px; }
.canopy-bar { height: 8px; border-radius: var(--radius-pill); background: var(--cc-surface-3); overflow: hidden; }
.canopy-bar > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #12B7AD, #A13BDF 60%, #FF8540); transition: width 0.6s var(--ease-out); }
.canopy-ticks { display: flex; justify-content: space-between; margin-top: 8px; }
.canopy-ticks span { font-size: 10.5px; font-weight: var(--fw-semibold); color: var(--fg-muted); }
.canopy-ticks span.hit { color: var(--acc); }
.canopy-badge-btn { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; background: var(--cc-indigo); color: #fff; border: 0; padding: 11px 18px; border-radius: var(--radius-sm); font-size: 14px; font-weight: var(--fw-bold); }
.canopy-badge-btn:hover { background: var(--cc-dark-purple); }

/* ---------------- Nav progress pill ---------------- */
.np-pill { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; white-space: nowrap; background: var(--cc-tint-green); color: #0F8F87; padding: 7px 12px 7px 8px; border-radius: var(--radius-pill); font-size: 12.5px; font-weight: var(--fw-bold); text-decoration: none; border: 1px solid #BEEFEA; }
.np-pill:hover { text-decoration: none; background: #D6F3F0; }
.np-pill .np-tree { display: flex; align-items: center; flex-shrink: 0; }
.np-pill .np-lbl { white-space: nowrap; }
.np-pill .np-full { color: var(--cc-indigo); }
@media (max-width: 760px) { .np-pill .np-lbl { display: none; } }

/* ---------------- Finisher overlay ---------------- */
.cf-overlay { position: fixed; inset: 0; z-index: 600; opacity: 0; transition: opacity 0.3s var(--ease-out); }
.cf-overlay.in { opacity: 1; }
.cf-overlay.stage { background: rgba(11,11,26,0.55); display: flex; align-items: center; justify-content: center; padding: 24px; }
.cf-overlay.mini { display: flex; align-items: flex-end; justify-content: center; padding: 0 16px 30px; pointer-events: none; }

/* mini power-up toast */
.cf-toast { pointer-events: auto; display: flex; align-items: center; gap: 14px; background: var(--cc-white); border: 1px solid var(--border-1); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 12px 18px 12px 12px; transform: translateY(20px); transition: transform 0.32s var(--ease-out); }
.cf-overlay.in .cf-toast { transform: translateY(0); }
.cf-toast-tree { position: relative; width: 56px; height: 56px; flex-shrink: 0; }
.cf-toast-t { font-size: 14.5px; font-weight: var(--fw-bold); color: var(--fg-1); }
.cf-toast-s { font-size: 12.5px; color: var(--fg-3); margin-top: 1px; }
.cf-pulse { position: absolute; inset: 0; margin: auto; width: 40px; height: 40px; border-radius: 50%; background: #12B7AD; opacity: 0.5; animation: cf-pulse 1.1s var(--ease-out) 1; }
@keyframes cf-pulse { 0% { transform: scale(0.4); opacity: 0.5; } 100% { transform: scale(2.4); opacity: 0; } }

/* big stage card */
.cf-card { position: relative; width: 440px; max-width: 100%; background: var(--cc-white); border-radius: var(--radius-2xl); box-shadow: var(--shadow-xl); padding: 32px 34px 30px; text-align: center; overflow: hidden; transform: translateY(14px) scale(0.97); transition: transform 0.34s var(--ease-out); }
.cf-overlay.in .cf-card { transform: translateY(0) scale(1); }
.cf-tier-pill { display: inline-block; font-size: 11px; font-weight: var(--fw-bold); letter-spacing: 0.1em; text-transform: uppercase; color: var(--cc-green); background: var(--cc-tint-green); padding: 6px 14px; border-radius: var(--radius-pill); margin-bottom: 14px; }
.cf-tree { position: relative; width: 200px; height: 200px; margin: 0 auto 6px; }
.cf-ring { position: absolute; inset: 0; margin: auto; width: 120px; height: 120px; border-radius: 50%; border: 2px solid #12B7AD; opacity: 0; animation: cf-ring 1.4s var(--ease-out) 0.2s 1; }
@keyframes cf-ring { 0% { transform: scale(0.5); opacity: 0.6; } 100% { transform: scale(2.2); opacity: 0; } }
.cf-tier { font-size: 12px; font-weight: var(--fw-bold); letter-spacing: 0.1em; text-transform: uppercase; color: var(--cc-green); }
.cf-title { font-size: 28px; font-weight: var(--fw-extrabold); letter-spacing: -0.02em; margin: 6px 0 8px; color: var(--fg-1); }
.cf-msg { font-size: 15.5px; line-height: 1.5; color: var(--fg-2); margin: 0 auto 20px; max-width: 34ch; }
.cf-prog { height: 8px; border-radius: var(--radius-pill); background: var(--cc-surface-3); overflow: hidden; }
.cf-prog > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #12B7AD, #A13BDF 60%, #FF8540); transition: width 0.7s var(--ease-out); }
.cf-prog-lbl { font-size: 12.5px; color: var(--fg-3); margin-top: 8px; font-weight: var(--fw-medium); }
.cf-actions { display: flex; gap: 10px; justify-content: center; margin-top: 22px; }
.cf-btn { padding: 12px 22px; border-radius: var(--radius-sm); font-size: 14.5px; font-weight: var(--fw-bold); border: 1.5px solid transparent; }
.cf-btn.primary { background: var(--cc-indigo); color: #fff; }
.cf-btn.primary:hover { background: var(--cc-dark-purple); }
.cf-btn.ghost { background: var(--cc-white); color: var(--fg-2); border-color: var(--border-2); }
.cf-btn.ghost:hover { border-color: var(--cc-indigo); color: var(--cc-indigo); }

/* falling leaves */
.cf-leaffall, .cf-toast-tree { pointer-events: none; }
.cf-leaffall { position: absolute; inset: 0; overflow: hidden; }
.cf-leaf { position: absolute; top: -14px; width: 11px; height: 11px; border-radius: 2px 8px 3px 8px; opacity: 0; animation: cf-fall 2s var(--ease-out) forwards; }
.cf-toast-tree .cf-leaf { animation-name: cf-fall-sm; }
@keyframes cf-fall { 0% { transform: translateY(-10px) rotate(0); opacity: 0; } 12% { opacity: 1; } 100% { transform: translateY(360px) rotate(var(--rot, 120deg)); opacity: 0; } }
@keyframes cf-fall-sm { 0% { transform: translateY(-6px) rotate(0); opacity: 0; } 18% { opacity: 1; } 100% { transform: translateY(70px) rotate(var(--rot, 120deg)); opacity: 0; } }

/* growing-tree sequence + zoom settle */
.cl-grow { animation: cl-pop 0.5s var(--ease-out) both; }
.cf-tree.zoom, .cf-finale-tree.zoom { animation: cf-zoom 0.85s var(--ease-out) both; }
@keyframes cf-zoom { 0% { transform: scale(1.12); opacity: 0.45; } 55% { opacity: 1; } 100% { transform: scale(1); } }

/* confetti pop (brand colors) */
.cf-confetti-host { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 3; }
.cf-confetti { position: absolute; top: 44%; left: 50%; opacity: 0; animation: cf-conf 1.3s cubic-bezier(0.15,0.7,0.3,1) forwards; }
.cf-confetti.dot { border-radius: 50%; }
.cf-confetti.sq { border-radius: 3px; }
.cf-confetti.dash { border-radius: 3px; }
.cf-confetti.spark { clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%); }
@keyframes cf-conf {
  0% { transform: translate(-50%,-50%) scale(0.5) rotate(0); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1) rotate(var(--rot)); opacity: 0; }
}

/* sparkles (mini moment) */
.cf-spark { position: absolute; width: 9px; height: 9px; opacity: 0; z-index: 2; clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%); animation: cf-spark 0.9s ease forwards; }
@keyframes cf-spark { 0% { transform: scale(0) rotate(0); opacity: 0; } 40% { transform: scale(1.25) rotate(45deg); opacity: 1; } 100% { transform: scale(0) rotate(90deg); opacity: 0; } }

/* ---------------- 100% full-screen finale ---------------- */
.cf-overlay.full { display: flex; align-items: center; justify-content: center; padding: 24px;
  background: #0E0578 url("gradients/gradient-3.jpg") center/cover; }
.cf-finale-bg { position: absolute; inset: 0; background: radial-gradient(circle at 50% 42%, rgba(14,5,120,0.05), rgba(7,3,63,0.62) 92%); }
.cf-finale { position: relative; z-index: 4; text-align: center; max-width: 560px; transform: translateY(16px); opacity: 0; transition: transform 0.5s var(--ease-out), opacity 0.5s; }
.cf-overlay.full.in .cf-finale { transform: translateY(0); opacity: 1; }
.cf-finale-tree { position: relative; width: 300px; height: 300px; margin: 0 auto 6px; }
.cf-rays { position: absolute; inset: -34px; margin: auto; border-radius: 50%; opacity: 0.5;
  background: conic-gradient(from 0deg, rgba(255,255,255,0), rgba(255,255,255,0.14), rgba(255,255,255,0) 26%, rgba(255,255,255,0.14) 50%, rgba(255,255,255,0) 74%, rgba(255,255,255,0.14), rgba(255,255,255,0));
  animation: cf-spin 16s linear infinite; }
@keyframes cf-spin { to { transform: rotate(360deg); } }
.cf-tier-pill.big { font-size: 12px; padding: 8px 18px; background: rgba(255,255,255,0.16); color: #fff; }
.cf-finale-title { font-size: clamp(34px, 5vw, 48px); font-weight: var(--fw-extrabold); letter-spacing: -0.025em; color: #fff; margin: 16px 0 12px; line-height: 1.03; }
.cf-finale-msg { font-size: 17px; line-height: 1.55; color: rgba(255,255,255,0.82); max-width: 42ch; margin: 0 auto 26px; }
.cf-btn.big { padding: 15px 28px; font-size: 15.5px; }
.cf-finale .cf-btn.ghost { background: rgba(255,255,255,0.1); color: #fff; border-color: rgba(255,255,255,0.28); }
.cf-finale .cf-btn.ghost:hover { background: rgba(255,255,255,0.2); border-color: #fff; color: #fff; }
.cf-overlay.full .cf-ring { border-color: rgba(255,255,255,0.5); width: 150px; height: 150px; }

@media (prefers-reduced-motion: reduce) {
  .cl-new, .cl-grow, .cf-pulse, .cf-ring, .cf-leaf, .cf-confetti, .cf-spark, .cf-rays, .cf-tree.zoom, .cf-finale-tree.zoom { animation: none !important; }
}
