/* ============================================================
   HireJuno — Welcome Wheel (css/wheel.css)
   Pairs with js/wheel.js. Loads AFTER css/brand.css and reuses
   its tokens (--juno-green, --paper, --r-xl, --shadow-lg, .btn).
   Every class is hjw- prefixed; nothing here leaks outside the
   modal. The wheel is presentation only — the $10 credit is
   granted server-side by the wheel-reward edge function.
   ============================================================ */

/* ---------- Overlay ---------- */
.hjw-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-4);
  background: rgba(15, 27, 45, .62);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .28s ease;
}
.hjw-overlay.hjw-visible { opacity: 1; }

/* ---------- Dialog card ---------- */
.hjw-dialog {
  position: relative;
  width: 100%;
  max-width: 460px;
  max-height: min(92vh, 92dvh);
  overflow-y: auto;
  background: var(--paper);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--s-6) var(--s-6) var(--s-5);
  text-align: center;
  transform: translateY(14px) scale(.97);
  transition: transform .32s cubic-bezier(.2, .9, .3, 1.15);
}
.hjw-overlay.hjw-visible .hjw-dialog { transform: translateY(0) scale(1); }

.hjw-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 1.05rem;
  line-height: 1;
}
.hjw-close:hover { background: var(--sand); color: var(--ink); }

/* ---------- Copy ---------- */
.hjw-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: var(--r-pill);
  background: var(--juno-green-tint);
  color: var(--juno-green-deep);
  font-family: var(--font-display);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: var(--s-3);
}
.hjw-title {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 4.5vw, 1.6rem);
  font-weight: 800;
  color: var(--ink);
  line-height: 1.2;
  margin: 0 0 var(--s-2);
}
.hjw-sub {
  font-size: .95rem;
  color: var(--ink-soft);
  margin: 0 0 var(--s-4);
}
.hjw-fineprint {
  font-size: .76rem;
  color: var(--ink-faint);
  margin: var(--s-3) 0 0;
}

/* ---------- Wheel ---------- */
.hjw-wheelwrap {
  position: relative;
  width: min(290px, 74vw);
  margin: 0 auto var(--s-4);
}
/* The SVG is re-rendered whenever the admin config changes, so it lives in a
   mount rather than being a direct child of the wrap. The mount is layout-
   neutral: the pointer and hub stay positioned against .hjw-wheelwrap. */
.hjw-svgmount { display: block; line-height: 0; }
.hjw-svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 50%;
  box-shadow: 0 6px 24px rgba(27, 42, 65, .18), inset 0 0 0 6px var(--paper);
  will-change: transform;
}
.hjw-svg.hjw-spin {
  transition: transform 4.2s cubic-bezier(.12, .72, .11, 1.02);
}
/* Pointer — fixed, does not rotate with the wheel */
.hjw-pointer {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 13px solid transparent;
  border-right: 13px solid transparent;
  border-top: 22px solid var(--navy);
  filter: drop-shadow(0 2px 2px rgba(15, 27, 45, .3));
  z-index: 2;
}
/* Hub — fixed centre cap over the rotating SVG */
.hjw-hub {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--paper);
  border: 4px solid var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(.9rem, 3.4vw, 1.15rem);
  color: var(--juno-green-deep);
  z-index: 1;
  box-shadow: var(--shadow-sm);
}

/* ---------- Actions ---------- */
.hjw-actions { display: grid; gap: var(--s-2); }
.hjw-actions .btn { width: 100%; }
.hjw-later {
  background: none;
  border: none;
  color: var(--ink-faint);
  font-size: .85rem;
  padding: 6px;
}
.hjw-later:hover { color: var(--ink-soft); text-decoration: underline; }

/* ---------- Result / error states ---------- */
.hjw-result-note {
  font-size: .95rem;
  color: var(--ink-soft);
  margin: 0 0 var(--s-4);
}
.hjw-error {
  color: var(--danger);
  font-size: .9rem;
  margin: 0 0 var(--s-3);
}
[hidden] { display: none !important; }

/* ---------- Confetti ---------- */
.hjw-confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  border-radius: var(--r-xl);
}
.hjw-confetti span {
  position: absolute;
  top: 18%;
  left: 50%;
  width: 9px;
  height: 14px;
  border-radius: 2px;
  opacity: 0;
}

/* ---------- Small screens ---------- */
@media (max-width: 480px) {
  .hjw-overlay { padding: var(--s-3); align-items: flex-end; }
  .hjw-dialog { padding: var(--s-5) var(--s-4) var(--s-4); }
}

/* ---------- Reduced motion: static reveal ----------
   brand.css already zeroes transitions/animations globally under
   prefers-reduced-motion; these keep the modal fully visible and the
   wheel readable with no travel at all. js/wheel.js skips the spin
   animation and the confetti in the same condition. */
@media (prefers-reduced-motion: reduce) {
  .hjw-overlay, .hjw-dialog { opacity: 1; transform: none; transition: none; }
  .hjw-svg.hjw-spin { transition: none; }
}
