/* Jubiloo Welcome Pop-up
   Uses the theme's design tokens where present, with Jubiloo fallbacks so the
   pop-up still looks right if a token is missing. */

html.jpop-lock {
  overflow: hidden;
}

.jpop {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  font-family: var(--font-body, "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
}

/* The overlay is a full-screen fixed layer, so it must genuinely disappear when
   it isn't open — otherwise it sits invisibly on top of the page and eats every
   click. Two safeguards:
   1. Honour the `hidden` attribute (the JS toggles it) even though `.jpop` sets
      a `display`, which would otherwise override the browser default.
   2. Never intercept pointer events unless the pop-up is actually open (covers
      the close-transition window and any case where `hidden` isn't set yet). */
.jpop[hidden] {
  display: none;
}
.jpop:not(.is-open) {
  pointer-events: none;
}
.jpop.is-open {
  pointer-events: auto;
}

.jpop__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 44, 89, 0.55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.jpop.is-open .jpop__backdrop {
  opacity: 1;
}

.jpop__card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: #fff9ef;
  border: 2px solid var(--color-primary, #092c59);
  border-radius: 16px;
  box-shadow: 14px 14px 0 rgba(254, 111, 97, 0.9);
  padding: 34px 30px 26px;
  text-align: center;
  overflow: hidden;
  opacity: 0;
  transform: translateY(18px) scale(0.96);
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.jpop.is-open .jpop__card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.jpop__hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.jpop__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--color-primary, #092c59);
  cursor: pointer;
  transition: background 0.15s ease;
}
.jpop__close:hover {
  background: rgba(9, 44, 89, 0.08);
}
.jpop__close svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
}

.jpop__deco {
  position: absolute;
  z-index: 0;
  color: var(--color-primary, #092c59);
  opacity: 0.16;
  pointer-events: none;
}
.jpop__deco svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}
.jpop__deco--heart {
  width: 58px;
  height: 58px;
  left: -14px;
  bottom: -12px;
  color: #a97fc4;
  opacity: 0.5;
}
.jpop__deco--heart svg {
  fill: currentColor;
  stroke: none;
}
.jpop__deco--burst {
  width: 46px;
  height: 46px;
  right: -8px;
  top: 48px;
  color: var(--color-yellow, #ffd600);
  opacity: 0.9;
}

.jpop__body {
  position: relative;
  z-index: 1;
}

.jpop__eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6b6f7a;
}

.jpop__title {
  margin: 0 0 10px;
  font-family: var(--font-head, "Baloo 2", "Figtree", sans-serif);
  line-height: 0.95;
  color: var(--color-primary, #092c59);
}
.jpop__title-big {
  display: block;
  font-size: clamp(44px, 12vw, 58px);
  font-weight: 800;
  letter-spacing: 0.01em;
}
.jpop__title-small {
  display: block;
  margin-top: 4px;
  font-size: clamp(17px, 4.5vw, 21px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.jpop__title--thanks {
  font-size: 30px;
  font-weight: 800;
  margin-bottom: 8px;
}

.jpop__sub {
  margin: 0 auto 16px;
  max-width: 30ch;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--color-text, #2b2b2b);
}
.jpop__sub strong {
  color: var(--color-primary, #092c59);
}

.jpop__form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}
.jpop__label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-primary, #092c59);
}
.jpop__input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 15px;
  color: var(--color-text, #2b2b2b);
  background: #fff;
  border: 2px solid var(--color-primary, #092c59);
  border-radius: 10px;
  box-sizing: border-box;
}
.jpop__input:focus {
  outline: 3px solid rgba(254, 111, 97, 0.4);
  outline-offset: 1px;
}
.jpop__input[aria-invalid="true"] {
  border-color: #d5462f;
}
.jpop__error {
  margin: 0;
  font-size: 12.5px;
  color: #d5462f;
}

.jpop__btn {
  display: inline-block;
  width: 100%;
  margin-top: 4px;
  padding: 13px 20px;
  font-family: var(--font-head, "Baloo 2", "Figtree", sans-serif);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: var(--color-coral, #ff6f61);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.1s ease;
}
.jpop__btn:hover {
  background: #ee5c4e;
}
.jpop__btn:active {
  transform: translateY(1px);
}
.jpop__btn[disabled] {
  opacity: 0.65;
  cursor: default;
}
.jpop__btn--shop {
  margin-top: 14px;
}

.jpop__fine {
  margin: 12px 0 0;
  font-size: 11px;
  line-height: 1.5;
  color: #8a8e99;
}

.jpop__decline {
  margin-top: 10px;
  padding: 4px;
  font-size: 12.5px;
  color: #8a8e99;
  background: none;
  border: 0;
  text-decoration: underline;
  cursor: pointer;
}
.jpop__decline:hover {
  color: var(--color-primary, #092c59);
}

/* --- revealed state --- */
.jpop__tick {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin: 0 auto 12px;
  border-radius: 999px;
  background: #3fae97;
  color: #fff;
}
.jpop__tick svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.jpop__code {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 100%;
  margin: 4px 0 2px;
  padding: 14px 16px;
  background: #fff;
  border: 2px dashed var(--color-primary, #092c59);
  border-radius: 12px;
  cursor: pointer;
}
.jpop__code-value {
  font-family: var(--font-head, "Baloo 2", "Figtree", sans-serif);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--color-primary, #092c59);
}
.jpop__code-hint {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8a8e99;
}
.jpop__code.is-copied {
  border-style: solid;
  border-color: #3fae97;
}
.jpop__code.is-copied .jpop__code-hint {
  color: #3fae97;
}

@media (max-width: 600px) {
  .jpop__card {
    padding: 30px 22px 22px;
    box-shadow: 9px 9px 0 rgba(254, 111, 97, 0.9);
  }
}

@media (prefers-reduced-motion: reduce) {
  .jpop__card,
  .jpop__backdrop {
    transition: opacity 0.2s ease;
    transform: none;
  }
  .jpop.is-open .jpop__card {
    transform: none;
  }
}
