/* static/css/funnel/scratch_discount.css
   Scratch-to-reveal discount step. All classes scoped to
   .step-scratch-discount / .sd-modal. */

.step-scratch-discount {
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
}

.sd-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 auto 18px;
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 600;
      color: var(--pf-accent);
    background: rgb(42 206 201 / 15%);
    border: 1px solid rgb(42 206 201);
  border-radius: var(--pf-radius-full, 999px);
}

.sd-title { margin-bottom: 8px; }
.sd-title-accent { color: var(--pf-accent); }
.sd-subtitle { margin-bottom: 22px; }

.sd-scratch {
  position: relative;
  width: 100%;
  max-width: 260px;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  border-radius: 20px;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.sd-reveal {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 20px;
  background: linear-gradient(325deg, #6ef3df, #cffffd);
  color: transparent;
}

.sd-reveal-gift { font-size: 2.6rem; line-height: 1; margin-bottom: 4px; }

.sd-reveal-label,
.sd-reveal-pct,
.sd-reveal-foot {
  color: var(--pf-success, #6ef3df);
}

.sd-reveal-label { font-size: 0.9rem; font-weight: 600; }
.sd-reveal-pct {
  font-family: var(--pf-font-display, inherit);
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.05;
}
.sd-reveal-foot { font-size: 0.78rem; max-width: 90%; }

.sd-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  transition: opacity 0.45s ease;
}
.sd-canvas:active { cursor: grabbing; }
.sd-scratch.sd-revealed .sd-canvas { opacity: 0; pointer-events: none; }

.sd-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 34px;
  pointer-events: none;
  filter: drop-shadow(0 2px 8px rgba(76, 117, 58, 0.4)) sepia(1) saturate(4) hue-rotate(75deg) brightness(0.6);
  animation: sd-hint-move 1.8s ease-in-out infinite;
}
.sd-hint.is-hidden { display: none; }

@keyframes sd-hint-move {
  0%   { transform: translate(-46px, -30px) rotate(-8deg) scale(1); }
  25%  { transform: translate(40px, 14px) rotate(2deg) scale(0.92); }
  50%  { transform: translate(-30px, 34px) rotate(-6deg) scale(1); }
  75%  { transform: translate(44px, -20px) rotate(4deg) scale(0.92); }
  100% { transform: translate(-46px, -30px) rotate(-8deg) scale(1); }
}

.sd-confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 90;
}

.sd-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(16, 10, 34, 0.5);
  opacity: 0;
  transition: opacity 0.25s ease;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  pointer-events: none;
}
.sd-modal[hidden] { display: none; }
.sd-modal.visible { opacity: 1; pointer-events: auto; }

.sd-modal-box {
  width: 100%;
  max-width: 340px;
  background: #1e1640;
  border: 1px solid rgba(162, 155, 254, 0.2);
  border-radius: 20px;
  padding: 26px 22px 18px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  transform: translateY(16px) scale(0.95);
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.sd-modal.visible .sd-modal-box {
  transform: translateY(0) scale(1);
}

/* ── Mobile: slide-up / slide-down bottom sheet ──────────── */
@media (max-width: 767px) {
  .sd-modal {
    align-items: flex-end;
    padding: 0;
  }

  .step-scratch-discount {
    min-height: 90dvh;
    padding-bottom: 0;
  }

  .sd-modal-box {
    max-width: 100%;
    border-radius: 24px 24px 0 0;
    border-bottom: none;
    padding: 12px 24px 24px;
    box-shadow: 0 -8px 48px rgba(0, 0, 0, 0.5);
    transform: translateY(100%);
    transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1);
  }

  .sd-modal.visible .sd-modal-box {
    transform: translateY(0);
    position: sticky;
    bottom: 0;
  }

  .sd-modal.dismissing .sd-modal-box {
    transform: translateY(100%);
  }

  /* drag-handle pill */
  .sd-modal-box::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: rgba(162, 155, 254, 0.25);
    border-radius: 2px;
    margin: 0 auto 18px;
  }

  .sd-modal-note { margin-bottom: 30px; }
}

.sd-modal-woohoo {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--pf-primary-light);
  margin-bottom: 14px;
}
.sd-modal-gift {
  line-height: 1;
  margin-bottom: 14px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sd-modal-gift::before {
  content: '';
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 220, 80, 0.18) 0%, rgb(180 138 225 / 6%) 50%, transparent 75%);
  pointer-events: none;
}

.sd-modal-gift img {
  display: block;
  margin: 0 auto;
  position: relative;
  filter: drop-shadow(0 0 18px rgba(108, 92, 231, 0.4));
}
.sd-modal-label {
  font-size: 0.9rem;
  color: var(--pf-text-dim, #a99fc7);
  margin-bottom: 4px;
}
.sd-modal-pct {
  font-family: var(--pf-font-display, inherit);
      font-size: 2rem;
    font-weight: 800;
    color: var(--pf-accent, #00CEC9);
    line-height: normal;
    margin-bottom: 18px;
    padding-bottom: 20px;
    border-bottom: 1px dashed var(--pf-border);
}
.sd-modal-cta {
  width: 100%;
  max-width: 100%;
  margin-top: 0;
  background: var(--pf-primary, #6c5ce7);
  box-shadow: 0 4px 16px rgba(108, 92, 231, 0.35);
}
.sd-modal-cta:hover { background: #5a4bd6; box-shadow: 0 6px 20px rgba(108, 92, 231, 0.45); transform: translateY(-2px); }
.sd-modal-cta:active { transform: scale(0.97) !important; box-shadow: 0 2px 10px rgba(108, 92, 231, 0.3); }
.sd-modal-cta:disabled,
.sd-modal-cta.is-loading { pointer-events: none; cursor: default; opacity: 0.65; }
.sd-modal-cta.is-loading::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  vertical-align: middle;
  position: relative;
  top: -1px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  opacity: 0.8;
  animation: btn-spin 0.7s linear infinite;
}
.sd-modal-note {
  font-size: 0.72rem;
  color: var(--pf-text-dim, #a99fc7);
  margin: 14px 0 0;
  line-height: 1.5;
  text-wrap: pretty;
}

@media (max-width: 767px) { .sd-scratch { max-width: 240px; } }