/* Reusable on every DOI landing page. Keep the shortcode outside this content. */
html:not(.e5-doi-editor):not(.e5-doi-show-success) .e5-doi-success {
  display: none !important;
}

/* The page's own success content replaces the plugin message after confirmation. */
html.e5-doi-show-success [data-e5enz-doi] {
  display: none !important;
}

/* Preserve hidden controls even when a theme applies its own display rules. */
[data-e5enz-doi] [hidden] {
  display: none !important;
}

[data-e5enz-doi] {
  --e5-doi-gold: linear-gradient(72deg, #B0891E 10%, #D8C25F 42%, #DFCC7C 52%, #B0891E 90%);
  text-align: center;
  opacity: 1;
  transition: opacity 140ms ease-out;
}

[data-e5enz-doi] .e5-doi-visual {
  position: relative;
  width: min(360px, 100%);
  height: 90px;
  margin: 0 auto 18px;
  pointer-events: none;
}

[data-e5enz-doi] .e5-doi-track {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #FEFCF4;
  box-shadow: inset 0 0 0 1px rgb(176 137 30 / 16%);
}

[data-e5enz-doi] .e5-doi-fill {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--e5-doi-gold);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 220ms ease-out;
}

[data-e5enz-doi][data-doi-state="pending"] .e5-doi-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 38%), transparent);
  animation: e5-doi-shimmer 1500ms linear infinite;
}

[data-e5enz-doi] .e5-doi-burst {
  position: absolute;
  left: 50%;
  top: 32px;
  width: 0;
  height: 0;
}

[data-e5enz-doi] .e5-doi-check {
  display: grid;
  place-items: center;
  position: absolute;
  left: -24px;
  top: -24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--e5-doi-gold);
  box-shadow: 0 0 25px rgb(216 194 95 / 26%);
  opacity: 0;
}

[data-e5enz-doi] .e5-doi-check svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: #FFFFFF;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[data-e5enz-doi] .e5-doi-ray {
  position: absolute;
  left: -1.5px;
  top: -7px;
  width: 3px;
  height: 14px;
  border-radius: 999px;
  background: var(--e5-doi-gold);
  opacity: 0;
  transform: rotate(var(--e5-angle)) translateY(-28px) scaleY(.3);
}

[data-e5enz-doi][data-doi-state="celebrating"] .e5-doi-check {
  animation: e5-doi-pop 420ms cubic-bezier(.2,.8,.3,1.2) both;
}

[data-e5enz-doi][data-doi-state="celebrating"] .e5-doi-ray {
  animation: e5-doi-rays 450ms ease-out both;
}

[data-e5enz-doi][data-doi-state="celebrating"] [data-doi-status] {
  color: #B0891E;
  font-weight: 600;
}

[data-e5enz-doi][data-doi-state="leaving"] {
  opacity: 0;
}

[data-e5enz-doi][data-doi-state="leaving"] .e5-doi-check {
  opacity: 1;
}

html.e5-doi-show-success .e5-doi-success {
  animation: e5-doi-content-in 180ms ease-out both;
}

@keyframes e5-doi-shimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}
@keyframes e5-doi-pop {
  0% { opacity: 0; transform: scale(.65); }
  55% { opacity: 1; transform: scale(1.1); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes e5-doi-rays {
  0% { opacity: 0; transform: rotate(var(--e5-angle)) translateY(-28px) scaleY(.3); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: rotate(var(--e5-angle)) translateY(-58px) scaleY(.65); }
}
@keyframes e5-doi-content-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  [data-e5enz-doi],
  [data-e5enz-doi] *,
  [data-e5enz-doi] *::after,
  html.e5-doi-show-success .e5-doi-success {
    animation: none !important;
    transition: none !important;
  }
}
