/* Luminiosa PRX scratch capture popup
   Preview with /pulserelief-x-vratni-masazer?scratch_popup=1&scratch_popup_mock=1 */

:root {
  --scratch-canvas: #F8F9FA;
  --scratch-navy: #0A2B4C;
  --scratch-muted: #5A6978;
  --scratch-coral: #FF7A59;
  --scratch-coral-dark: #E86A4A;
  --scratch-blue: #A2C1D9;
  --scratch-grey: #EDEFF1;
  --scratch-success: #2D8B5F;
}

.lum-scratch-open {
  overflow: hidden;
}

html[data-lum-scratch-native-suppressed="true"] .klaviyo-form,
html[data-lum-scratch-native-suppressed="true"] div[data-testid="POPUP"],
html[data-lum-scratch-native-suppressed="true"] .needsclick[class*="kl-private-reset-css"],
html[data-lum-scratch-native-suppressed="true"] [class*="klaviyo-form"],
.lum-scratch-open .klaviyo-form,
.lum-scratch-open div[data-testid="POPUP"],
.lum-scratch-open .needsclick[class*="kl-private-reset-css"],
.lum-scratch-open [class*="klaviyo-form"] {
  display: none !important;
  visibility: hidden !important;
}

.lum-scratch-popup[hidden],
.lum-scratch-popup__screen[hidden] {
  display: none !important;
}

.lum-scratch-popup {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  place-items: center;
  padding: 24px;
  --physio-navy: var(--scratch-navy);
  --text-muted: var(--scratch-muted);
  --therapy-coral: var(--scratch-coral);
  --clinical-blue: var(--scratch-blue);
  --paper-soft: var(--scratch-grey);
  --radius-lg: 16px;
  --radius-full: 9999px;
  --shadow-soft: 0 8px 30px rgba(10, 43, 76, 0.1);
  color: var(--scratch-navy);
  font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.lum-scratch-popup__overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 43, 76, 0.48);
  backdrop-filter: blur(8px);
}

.lum-scratch-popup__dialog {
  position: relative;
  width: min(760px, calc(100vw - 48px));
  max-height: min(720px, calc(100dvh - 16px));
  overflow: auto;
  border: 1px solid rgba(10, 43, 76, 0.08);
  border-radius: 28px;
  background: linear-gradient(180deg, #FFFFFF 0%, #F8FBFD 100%);
  box-shadow: 0 24px 80px rgba(10, 43, 76, 0.24);
  animation: lumScratchEnter 220ms ease both;
  -webkit-overflow-scrolling: touch;
}

.lum-scratch-popup__dialog:focus {
  outline: none;
}

.lum-scratch-popup__close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 3;
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(10, 43, 76, 0.12);
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--scratch-navy);
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.lum-scratch-popup__close:hover {
  transform: translateY(-1px);
  background: #FFFFFF;
  border-color: rgba(10, 43, 76, 0.22);
}

.lum-scratch-popup__close:focus-visible,
.lum-scratch-popup button:focus-visible,
.lum-scratch-popup input:focus-visible {
  outline: 3px solid rgba(162, 193, 217, 0.75);
  outline-offset: 3px;
}

.lum-scratch-popup__body {
  padding: 36px 44px 30px;
}

.lum-scratch-popup__screen {
  animation: lumScratchFade 180ms ease both;
}

.lum-scratch-popup__screen[data-screen="scratch"] {
  display: grid;
  grid-template-columns: minmax(250px, 1fr) minmax(300px, 340px);
  gap: 36px;
  align-items: center;
}

.lum-scratch-popup__copy-block,
.lum-scratch-popup__screen[data-screen="email"],
.lum-scratch-popup__screen[data-screen="success"] {
  text-align: center;
}

.lum-scratch-popup__copy-block {
  text-align: left;
}

.lum-scratch-popup__screen[data-screen="email"],
.lum-scratch-popup__screen[data-screen="success"] {
  display: grid;
  justify-items: center;
  margin: 0 auto;
  padding: 8px 0;
}

.lum-scratch-popup__screen[data-screen="email"] {
  width: min(100%, 390px);
  max-width: 390px;
}

.lum-scratch-popup__screen[data-screen="success"] {
  width: min(100%, 650px);
  max-width: 650px;
  padding: 0;
}

.lum-scratch-popup__screen[data-screen="email"] .lum-scratch-popup__brand-logo,
.lum-scratch-popup__screen[data-screen="success"] .lum-scratch-popup__brand-logo {
  margin-left: auto;
  margin-right: auto;
  object-position: center;
}

.lum-scratch-popup__brand-logo {
  display: block;
  width: min(156px, 42vw);
  height: auto;
  max-height: 22px;
  margin: 0 0 16px;
  object-fit: contain;
  object-position: left center;
  filter: brightness(0) saturate(100%) invert(15%) sepia(47%) saturate(1287%) hue-rotate(173deg) brightness(91%) contrast(97%);
  opacity: 0.46;
}

.lum-scratch-popup__title {
  margin: 0 0 12px;
  color: var(--scratch-navy);
  font-size: clamp(2rem, 3vw, 2.62rem);
  line-height: 1.04;
  font-weight: 900;
  letter-spacing: 0;
}

.lum-scratch-popup__copy {
  margin: 0;
  max-width: 34ch;
  color: var(--scratch-muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.lum-scratch-popup__screen[data-screen="email"] .lum-scratch-popup__copy,
.lum-scratch-popup__screen[data-screen="success"] .lum-scratch-popup__copy {
  margin: 0 auto;
}

.lum-scratch-popup__stage {
  display: grid;
  justify-items: center;
  text-align: center;
}

.lum-scratch-card {
  position: relative;
  width: min(100%, 338px);
  aspect-ratio: 720 / 636;
  margin: 0 auto 18px;
  border-radius: 22px;
  background: transparent;
  touch-action: none;
}

.lum-scratch-card__prize,
.lum-scratch-card__fallback {
  position: absolute;
  inset: 5%;
  display: grid;
  place-items: center;
  padding: 24px;
}

.lum-scratch-card__prize {
  opacity: 0;
  pointer-events: none;
}

.lum-scratch-card.is-scratching .lum-scratch-card__prize {
  opacity: 0.2;
}

.lum-scratch-card.is-revealed .lum-scratch-card__prize {
  opacity: 1;
  border: 1px solid rgba(10, 43, 76, 0.08);
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 122, 89, 0.12), transparent 40%),
    linear-gradient(180deg, #FFFFFF 0%, #F8F9FA 100%);
  box-shadow: 0 16px 42px rgba(10, 43, 76, 0.1);
}

.lum-scratch-card__fallback {
  z-index: 2;
  gap: 12px;
  align-content: center;
  border: 1px solid rgba(10, 43, 76, 0.08);
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 122, 89, 0.12), transparent 40%),
    linear-gradient(180deg, #FFFFFF 0%, #F8F9FA 100%);
  box-shadow: 0 16px 42px rgba(10, 43, 76, 0.1);
}

.lum-scratch-card__fallback[hidden] {
  display: none;
}

.lum-scratch-card__canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
  filter: drop-shadow(0 18px 24px rgba(10, 43, 76, 0.14));
}

.lum-scratch-card__canvas:active {
  cursor: grabbing;
}

.lum-scratch-card.is-revealed .lum-scratch-card__canvas {
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.lum-scratch-prize__small {
  margin: 0 0 10px;
  color: var(--scratch-muted);
  font-size: 0.84rem;
  font-weight: 900;
  text-transform: uppercase;
}

.lum-scratch-prize__amount {
  margin: 0;
  color: var(--scratch-navy);
  font-size: clamp(2.35rem, 6vw, 3.4rem);
  line-height: 0.96;
  font-weight: 900;
}

.lum-scratch-prize__text {
  margin: 10px auto 0;
  max-width: 20ch;
  color: var(--scratch-navy);
  font-size: 1.05rem;
  line-height: 1.34;
  font-weight: 800;
}

.lum-scratch-popup__hint {
  min-height: 22px;
  margin: 0 0 16px;
  color: var(--scratch-muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.lum-scratch-popup__hint strong {
  color: var(--scratch-navy);
}

.lum-scratch-popup__button {
  display: inline-flex;
  width: min(100%, 312px);
  min-height: 54px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 9999px;
  background: var(--scratch-coral);
  color: #FFFFFF;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(255, 122, 89, 0.26);
  transition: transform 160ms ease, background-color 160ms ease, opacity 160ms ease;
}

.lum-scratch-popup__button:hover {
  transform: translateY(-1px);
  background: var(--scratch-coral-dark);
}

.lum-scratch-popup__button:disabled {
  opacity: 0.54;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.lum-scratch-popup__button[hidden] {
  display: none;
}

.lum-scratch-popup__button--secondary {
  margin-top: 22px;
  background: var(--scratch-navy);
  box-shadow: 0 10px 28px rgba(10, 43, 76, 0.18);
}

.lum-scratch-popup__screen[data-screen="success"] .lum-scratch-popup__button--secondary {
  width: min(100%, 312px);
}

.lum-scratch-popup__button--secondary:hover {
  background: #123B63;
}

.lum-scratch-form {
  width: min(100%, 340px);
  margin: 24px auto 0;
  display: grid;
  justify-items: stretch;
  gap: 12px;
}

.lum-scratch-form .lum-scratch-popup__button {
  width: 100%;
}

.lum-scratch-form__label {
  text-align: left;
  color: var(--scratch-navy);
  font-size: 0.9rem;
  font-weight: 900;
}

.lum-scratch-form__input {
  width: 100%;
  min-height: 54px;
  border: 1.5px solid rgba(10, 43, 76, 0.12);
  border-radius: 14px;
  background: #FFFFFF;
  color: var(--scratch-navy);
  font: inherit;
  font-size: 1rem;
  padding: 0 16px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.lum-scratch-form__input::placeholder {
  color: rgba(90, 105, 120, 0.7);
}

.lum-scratch-form__input:focus {
  border-color: var(--scratch-blue);
  box-shadow: 0 0 0 4px rgba(162, 193, 217, 0.2);
}

.lum-scratch-form__legal {
  max-width: 42ch;
  margin: 0 auto;
  color: var(--scratch-muted);
  font-size: 0.64rem;
  line-height: 1.36;
  text-align: center;
}

.lum-scratch-popup__error {
  min-height: 20px;
  margin: 0;
  color: #B42318;
  font-size: 0.86rem;
  line-height: 1.38;
  text-align: left;
}

.lum-scratch-popup__success-mark {
  width: 46px;
  height: 46px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 9999px;
  background: rgba(45, 139, 95, 0.12);
  color: var(--scratch-success);
}

.lum-scratch-success {
  width: 100%;
  display: grid;
  justify-items: center;
  text-align: center;
}

.lum-scratch-countdown {
  display: inline-flex;
  align-items: center;
  margin: 0 2px;
  padding: 3px 8px;
  border: 1px solid rgba(255, 122, 89, 0.26);
  border-radius: 9999px;
  background: rgba(255, 122, 89, 0.1);
  color: var(--scratch-coral-dark);
  font-size: 1.02em;
  line-height: 1;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  vertical-align: baseline;
}

.lum-scratch-code-pill {
  margin: 13px 0 14px;
  padding: 8px 13px;
  border: 1px solid rgba(10, 43, 76, 0.1);
  border-radius: 9999px;
  background: #FFFFFF;
  color: var(--scratch-muted);
  font-size: 0.84rem;
  line-height: 1.2;
  box-shadow: 0 8px 22px rgba(10, 43, 76, 0.06);
}

.lum-scratch-code-pill strong {
  color: var(--scratch-navy);
  letter-spacing: 0.02em;
}

.lum-scratch-popup__screen[data-screen="success"] .lum-scratch-popup__title {
  margin-bottom: 12px;
  font-size: clamp(1.9rem, 2.5vw, 2.35rem);
}

.lum-scratch-popup__screen[data-screen="success"] .lum-scratch-popup__copy {
  max-width: 53ch;
  font-size: 0.98rem;
  line-height: 1.45;
}

.lum-scratch-popup__screen[data-screen="success"] .lum-scratch-popup__success-mark {
  width: 40px;
  height: 40px;
  margin-bottom: 8px;
}

.lum-scratch-popup__screen[data-screen="success"] .lum-scratch-popup__brand-logo {
  margin-bottom: 10px;
}

.lum-scratch-packages.package-grid {
  width: 100%;
  max-width: 620px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  align-items: stretch;
}

.lum-scratch-package-card.package-card {
  min-height: 286px;
  overflow: visible;
  box-shadow: 0 12px 30px rgba(10, 43, 76, 0.08);
}

.lum-scratch-package-card.package-card:hover {
  box-shadow: 0 18px 38px rgba(10, 43, 76, 0.12);
}

.lum-scratch-package-card.package-card.compact img {
  height: min(132px, 25vw);
  aspect-ratio: auto;
  object-fit: cover;
  object-position: center;
}

.lum-scratch-package-card .package-title {
  margin-top: 2px;
}

.lum-scratch-code-price {
  display: grid;
  gap: 4px;
  margin: 1px 0 0;
}

.lum-scratch-code-price__row {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 7px;
}

.lum-scratch-price-was {
  color: rgba(90, 105, 120, 0.82);
  font-size: 0.82rem;
  font-weight: 850;
  line-height: 1;
  text-decoration-line: line-through;
  text-decoration-color: rgba(255, 122, 89, 0.95);
  text-decoration-thickness: 2px;
}

.lum-scratch-code-price__row strong {
  color: var(--scratch-navy);
  font-size: clamp(1.1rem, 0.7vw + 0.98rem, 1.24rem);
  line-height: 1;
  font-weight: 900;
}

.lum-scratch-code-price__helper {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  color: var(--scratch-muted);
  font-size: 0.7rem;
  line-height: 1.2;
  font-weight: 850;
}

.lum-scratch-code-price__per-unit {
  color: var(--scratch-navy);
}

.lum-scratch-package-card .package-shipping {
  margin: 8px -14px -14px;
  width: calc(100% + 28px);
  padding: 8px 10px;
  font-size: 0.7rem;
  line-height: 1.15;
}

.lum-scratch-package-card.blue .package-card-cta {
  background: var(--scratch-navy);
}

.lum-scratch-package-card:disabled,
.lum-scratch-device-link:disabled {
  cursor: progress;
  opacity: 0.62;
  transform: none;
}

.lum-scratch-device-link.device-link {
  grid-column: 1 / -1;
  justify-self: center;
  width: 100%;
  max-width: min(100%, 620px);
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 4px 7px;
  margin: 10px 0 0;
  padding: 6px 10px 0;
  color: var(--scratch-muted);
  font-size: 0.84rem;
  line-height: 1.25;
}

.lum-scratch-device-link.device-link:hover {
  color: var(--scratch-navy);
}

.lum-scratch-device-link__lead {
  font-weight: 600;
}

.lum-scratch-device-link__main {
  color: var(--scratch-muted);
  font-weight: 600;
}

.lum-scratch-device-link__price {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
}

.lum-scratch-device-link__price strong {
  color: var(--scratch-navy);
  font-size: 0.92rem;
  font-weight: 900;
}

.lum-scratch-checkout-status {
  min-height: 20px;
  margin: 14px 0 0;
  color: var(--scratch-muted);
  font-size: 0.82rem;
  line-height: 1.34;
}

.lum-scratch-checkout-status.is-error {
  color: #B42318;
}

@keyframes lumScratchEnter {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

@media (max-width: 640px) {
  .lum-scratch-popup {
    display: block;
    padding: 0;
    background: #F8FBFD;
  }

  .lum-scratch-popup__overlay {
    display: none;
  }

  .lum-scratch-popup__dialog {
    width: 100%;
    height: 100dvh;
    max-height: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .lum-scratch-popup__close {
    position: fixed;
    top: max(14px, env(safe-area-inset-top));
    right: 14px;
  }

  .lum-scratch-popup__body {
    min-height: 100dvh;
    padding: max(62px, calc(env(safe-area-inset-top) + 36px)) 22px max(24px, calc(env(safe-area-inset-bottom) + 24px));
    display: grid;
    align-items: center;
  }

  .lum-scratch-popup__screen[data-screen="scratch"] {
    min-height: calc(100dvh - 96px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0;
  }

  .lum-scratch-popup__copy-block {
    text-align: center;
  }

  .lum-scratch-popup__brand-logo {
    width: min(148px, 46vw);
    max-height: 20px;
    margin: 0 auto 14px;
    object-position: center;
  }

  .lum-scratch-popup__title {
    font-size: clamp(1.78rem, 8vw, 2.36rem);
    line-height: 1.06;
  }

  .lum-scratch-popup__copy {
    max-width: 31ch;
    margin: 0 auto;
    font-size: 1rem;
  }

  .lum-scratch-popup__stage {
    margin-top: 22px;
  }

  .lum-scratch-card {
    width: min(88vw, 340px);
    margin-bottom: 14px;
  }

  .lum-scratch-popup__button,
  .lum-scratch-form {
    width: min(100%, 340px);
  }

  .lum-scratch-popup__screen[data-screen="email"],
  .lum-scratch-popup__screen[data-screen="success"] {
    min-height: calc(100dvh - 96px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0;
  }

  .lum-scratch-popup__screen[data-screen="success"] {
    min-height: calc(100dvh - 96px);
    justify-content: flex-start;
    padding: 4px 0 20px;
  }

  .lum-scratch-popup__success-mark {
    width: 44px;
    height: 44px;
    margin-bottom: 12px;
  }

  .lum-scratch-popup__screen[data-screen="success"] .lum-scratch-popup__title {
    max-width: 16ch;
    margin-left: auto;
    margin-right: auto;
    font-size: clamp(1.58rem, 7vw, 2rem);
  }

  .lum-scratch-popup__screen[data-screen="success"] .lum-scratch-popup__copy {
    max-width: 38ch;
    font-size: 0.92rem;
    line-height: 1.38;
  }

  .lum-scratch-countdown {
    padding: 3px 7px;
    font-size: 1em;
  }

  .lum-scratch-code-pill {
    margin-top: 12px;
    margin-bottom: 12px;
  }

  .lum-scratch-packages.package-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .lum-scratch-package-card.package-card {
    min-height: 282px;
    gap: 6px;
    padding: 9px;
    border-radius: 14px;
  }

  .lum-scratch-package-card.package-card.compact img {
    aspect-ratio: 3 / 2;
  }

  .lum-scratch-package-card .package-title {
    font-size: 0.88rem;
  }

  .lum-scratch-package-card .package-subtitle {
    font-size: 0.7rem;
    line-height: 1.24;
  }

  .lum-scratch-code-price__row {
    gap: 5px;
  }

  .lum-scratch-price-was {
    font-size: 0.68rem;
  }

  .lum-scratch-code-price__row strong {
    font-size: 1rem;
  }

  .lum-scratch-code-price__helper {
    gap: 4px;
    font-size: 0.62rem;
  }

  .lum-scratch-package-card .package-shipping {
    margin: 7px -9px -9px;
    width: calc(100% + 18px);
    padding: 6px 6px;
    font-size: 0.6rem;
  }

  .lum-scratch-package-card .package-shipping::before {
    width: 12px;
    height: 12px;
  }

  .lum-scratch-package-card .package-card-cta {
    min-height: 34px;
    padding: 0 8px;
    font-size: 0.72rem;
  }

  .lum-scratch-device-link.device-link {
    margin-top: 10px;
    padding-top: 2px;
    font-size: 0.76rem;
    gap: 3px 6px;
  }

  .lum-scratch-device-link__price strong {
    font-size: 0.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lum-scratch-popup__dialog,
  .lum-scratch-popup__screen {
    animation: none;
  }

  .lum-scratch-popup__close,
  .lum-scratch-popup__button,
  .lum-scratch-card__canvas {
    transition: none;
  }
}
