/* OEUK Envelope Invite — front-end styles
   All selectors are prefixed .oeuk-ei- to avoid clashing with theme styles.
   No page-level background is applied here on purpose: the widget is meant
   to drop into whatever page it's placed on. */

.oeuk-ei-wrap {
  --oeuk-navy-950: #0A1826;
  --oeuk-navy-800: #12293D;
  --oeuk-navy-700: #1A3A54;
  --oeuk-navy-600: #244A69;
  --oeuk-purple: #5B2C82;
  --oeuk-blue: #2D6693;
  --oeuk-teal: #0EA99B;
  --oeuk-gradient: linear-gradient(100deg, var(--oeuk-purple) 0%, var(--oeuk-blue) 55%, var(--oeuk-teal) 100%);
  --oeuk-parchment: #FBF6EA;
  --oeuk-ink-900: #1E1B12;
  --oeuk-ink-600: #5B5642;

  display: block;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.oeuk-ei-wrap * { box-sizing: border-box; }

.oeuk-ei-stage {
  width: 100% !important;
  display: flex !important;
  align-items: flex-start !important;
  justify-content: center !important;
  padding: 1.5rem 0.5rem;
  text-align: center;
}

.oeuk-ei-scene {
  position: relative;
  width: min(460px, 100%);
  margin: 0 auto;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
}

.oeuk-ei-caption {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--oeuk-teal);
  opacity: 0.9;
  margin: 0 0 1.25rem;
  text-align: center;
  transition: opacity 0.4s ease;
}
.oeuk-ei-scene.is-open .oeuk-ei-caption { opacity: 0; height: 0; margin: 0; overflow: hidden; }

.oeuk-ei-stack {
  position: relative;
  width: 100%;
  display: grid;
}
.oeuk-ei-stack > * {
  grid-column: 1;
  grid-row: 1;
  justify-self: center;
  align-self: start;
}

/* ---------- ENVELOPE ---------- */

.oeuk-ei-envelope-btn {
  all: unset;
  position: relative;
  width: min(400px, 100%);
  aspect-ratio: 3 / 2;
  cursor: pointer;
  display: block;
  margin: 0 auto;
  z-index: 2;
  transition: transform 0.55s ease, opacity 0.55s ease;
}
.oeuk-ei-envelope-btn:focus-visible .oeuk-ei-pocket {
  outline: 2px solid var(--oeuk-teal);
  outline-offset: 4px;
}
.oeuk-ei-scene.is-open .oeuk-ei-envelope-btn {
  transform: translateY(4%) scale(0.94);
  opacity: 0;
  pointer-events: none;
}

.oeuk-ei-pocket {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, var(--oeuk-navy-700), var(--oeuk-navy-800) 70%);
  border-radius: 6px;
  box-shadow: 0 20px 44px -18px rgba(0,0,0,0.5), 0 2px 0 rgba(255,255,255,0.03) inset;
}
.oeuk-ei-pocket::before, .oeuk-ei-pocket::after {
  content: "";
  position: absolute;
  bottom: 0;
  width: 55%;
  height: 78%;
  background: linear-gradient(180deg, rgba(255,255,255,0.05), transparent 60%);
  clip-path: polygon(0 100%, 100% 100%, 50% 0%);
}
.oeuk-ei-pocket::before { left: -5%; }
.oeuk-ei-pocket::after { right: -5%; transform: scaleX(-1); }

.oeuk-ei-flap {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 58%;
  clip-path: polygon(0 0, 100% 0, 50% 92%);
  background: linear-gradient(200deg, var(--oeuk-navy-600), var(--oeuk-navy-700) 75%);
  transform-origin: top center;
  transition: transform 0.85s cubic-bezier(.5,-0.2,.3,1.3), opacity 0.65s ease 0.15s;
  z-index: 3;
  box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset;
}
.oeuk-ei-scene.is-open .oeuk-ei-flap { transform: translateY(-115%) rotateZ(-6deg); opacity: 0; }

.oeuk-ei-seal {
  position: absolute; top: 46%; left: 50%; width: 25%; aspect-ratio: 1;
  transform: translate(-50%, -50%); z-index: 4;
}
.oeuk-ei-seal-half {
  position: absolute; inset: 0; border-radius: 50%;
  background: var(--oeuk-gradient);
  box-shadow: 0 3px 8px rgba(0,0,0,0.5), 0 0 0 1px rgba(0,0,0,0.15) inset;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.55s ease, opacity 0.45s ease;
}
.oeuk-ei-seal-half--left { clip-path: polygon(0 0, 52% 0, 48% 100%, 0 100%); }
.oeuk-ei-seal-half--right { clip-path: polygon(52% 0, 100% 0, 100% 100%, 48% 100%); }
.oeuk-ei-scene.is-open .oeuk-ei-seal-half--left { transform: translate(-70%, 30%) rotate(-25deg); opacity: 0; }
.oeuk-ei-scene.is-open .oeuk-ei-seal-half--right { transform: translate(70%, 30%) rotate(25deg); opacity: 0; }

.oeuk-ei-seal-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60%;
  height: auto;
  transform: translate(-50%, -50%);
  z-index: 5;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.5s ease;
}
.oeuk-ei-scene.is-open .oeuk-ei-seal-logo {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.7);
}

/* ---------- PASS ---------- */

.oeuk-ei-pass-wrap {
  display: none;
  width: 100%;
  margin-top: 4%;
  transform: translateY(12%) scale(0.75);
  opacity: 0;
  z-index: 1;
  transition: transform 0.7s cubic-bezier(.16,.9,.28,1.05) 0.3s, opacity 0.55s ease 0.3s;
}
.oeuk-ei-scene.is-open .oeuk-ei-pass-wrap { transform: translateY(0) scale(1); opacity: 1; }

.oeuk-ei-pass {
  display: flex;
  width: min(840px, 100%);
  margin: 0 auto;
  text-align: left;
  background: var(--oeuk-parchment);
  color: var(--oeuk-ink-900);
  border-radius: 6px;
  box-shadow: 0 26px 54px -20px rgba(0,0,0,0.4);
  position: relative;
  overflow: hidden;
}

.oeuk-ei-pass-topbar { position: absolute; top: 0; left: 0; right: 0; height: 5px; background: var(--oeuk-gradient); }

/* two columns on wider screens (landscape), one column stacked on mobile (portrait) */
.oeuk-ei-pass-body {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr;
}

.oeuk-ei-pass-info {
  padding: 1.9rem 1.5rem 1.6rem;
}

.oeuk-ei-pass-form {
  padding: 1.5rem 1.5rem 1.9rem;
  border-top: 1px dashed rgba(30,27,18,0.18);
}

.oeuk-ei-logo-row { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 1.1rem; flex-wrap: wrap; }
/* !important here is deliberate: many themes set a blanket `img { height: auto }`
   (or similar) which otherwise silently overrides this and lets the logo render
   at its full native size. */
.oeuk-ei-logo {
  height: 20px !important;
  width: auto !important;
  max-width: 130px !important;
  max-height: none !important;
  display: block;
  flex-shrink: 0;
}
.oeuk-ei-eyebrow {
  font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--oeuk-blue); font-weight: 600;
}

.oeuk-ei-pass-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 600;
  font-size: clamp(1.3rem, 4.4vw, 1.6rem);
  line-height: 1.18;
  margin: 0 0 1.2rem;
  color: var(--oeuk-ink-900);
}

.oeuk-ei-pass-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem 1rem;
  padding: 0.9rem 0;
  border-top: 1px solid rgba(30,27,18,0.14);
  border-bottom: 1px solid rgba(30,27,18,0.14);
}
.oeuk-ei-pass-field { min-width: 0; }
.oeuk-ei-pass-field--full { grid-column: 1 / -1; }
.oeuk-ei-label {
  display: block;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--oeuk-purple);
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.oeuk-ei-value { font-size: 0.92rem; font-weight: 500; color: var(--oeuk-ink-900); }
.oeuk-ei-value--mono { font-family: Menlo, Consolas, monospace; font-size: 0.98rem; }

.oeuk-ei-pass-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.oeuk-ei-pass-chip {
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border: 1px solid rgba(30,27,18,0.25);
  border-radius: 3px;
  color: var(--oeuk-ink-900);
}

.oeuk-ei-barcode {
  margin-top: 1.1rem;
  height: 30px;
  background-image: repeating-linear-gradient(
    90deg,
    var(--oeuk-ink-900) 0px, var(--oeuk-ink-900) 2px,
    transparent 2px, transparent 5px,
    var(--oeuk-ink-900) 5px, var(--oeuk-ink-900) 6px,
    transparent 6px, transparent 10px,
    var(--oeuk-ink-900) 10px, var(--oeuk-ink-900) 13px,
    transparent 13px, transparent 16px
  );
  opacity: 0.8;
}

.oeuk-ei-footnote { font-size: 0.74rem; color: var(--oeuk-ink-600); margin: 0.8rem 0 0; }

.oeuk-ei-form-heading {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--oeuk-blue);
  font-weight: 600;
  margin: 0 0 0.9rem;
}

/* ---- native registration form ---- */

.oeuk-ei-hp-wrap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.oeuk-ei-field { margin-bottom: 0.9rem; }
.oeuk-ei-field.oeuk-ei-conditional[hidden] { display: none; }

.oeuk-ei-field-label {
  display: block;
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--oeuk-purple);
  font-weight: 700;
  margin: 0 0 0.35rem;
  padding: 0;
}

fieldset.oeuk-ei-field { border: none; margin-left: 0; margin-right: 0; padding: 0; }

.oeuk-ei-input,
.oeuk-ei-textarea {
  width: 100%;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--oeuk-ink-900);
  background: #fff;
  border: 1px solid rgba(30,27,18,0.25);
  border-radius: 3px;
  padding: 0.55rem 0.65rem;
}
.oeuk-ei-input:focus-visible, .oeuk-ei-textarea:focus-visible {
  outline: 2px solid var(--oeuk-teal);
  outline-offset: 1px;
}
.oeuk-ei-textarea { resize: vertical; min-height: 3rem; }

.oeuk-ei-radio-row { display: flex; gap: 1.1rem; flex-wrap: wrap; }
.oeuk-ei-radio-row label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  color: var(--oeuk-ink-900);
}
.oeuk-ei-radio-row input { accent-color: var(--oeuk-teal); width: 15px; height: 15px; }

.oeuk-ei-cta {
  all: unset;
  box-sizing: border-box;
  display: block;
  width: 100%;
  text-align: center;
  background: var(--oeuk-gradient);
  color: #fff;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.85rem 1rem;
  border-radius: 3px;
  cursor: pointer;
  transition: filter 0.2s ease, opacity 0.2s ease;
}
.oeuk-ei-cta:hover, .oeuk-ei-cta:focus-visible { filter: brightness(1.12); }
.oeuk-ei-cta:focus-visible { outline: 2px solid var(--oeuk-teal); outline-offset: 2px; }
.oeuk-ei-cta[disabled] { opacity: 0.6; cursor: default; pointer-events: none; }

.oeuk-ei-form-error {
  font-size: 0.82rem;
  color: #9B3B3B;
  background: rgba(155,59,59,0.08);
  border: 1px solid rgba(155,59,59,0.3);
  border-radius: 4px;
  padding: 0.6rem 0.75rem;
  margin: 0 0 0.9rem;
}
.oeuk-ei-form-error[hidden] { display: none; }

.oeuk-ei-form-status {
  font-size: 0.82rem;
  color: var(--oeuk-ink-600);
  margin-top: 0.9rem;
  text-align: center;
}
.oeuk-ei-form-status[hidden] { display: none; }
.oeuk-ei-form-status.is-success { color: var(--oeuk-teal); font-weight: 600; }
.oeuk-ei-form-status.is-error { color: #9B3B3B; }

/* ---- "your pass" result state, once registered ----
   .oeuk-ei-result-actions is deliberately NOT inside .oeuk-ei-pass: that
   element is exactly what gets captured as the downloadable/emailed image,
   so keeping the download button and status text outside it guarantees
   they can never end up baked into that picture. */

.oeuk-ei-pass-body[data-state="result"] {
  display: block;
  padding: 1.9rem 1.5rem;
}
.oeuk-ei-pass-body[data-state="result"] .oeuk-ei-pass-info {
  padding: 0;
  max-width: 480px;
  margin: 0 auto;
}
.oeuk-ei-result-actions {
  max-width: 480px;
  margin: 1.25rem auto 0;
  text-align: center;
}
.oeuk-ei-result-actions .oeuk-ei-cta { margin-bottom: 0.7rem; }

.oeuk-ei-pass-stub {
  width: 84px;
  flex-shrink: 0;
  background: var(--oeuk-navy-950);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 1.1rem 0 0.9rem;
  border-left: 2px dashed rgba(233,226,204,0.25);
}
.oeuk-ei-pass-stub::before, .oeuk-ei-pass-stub::after {
  content: "";
  position: absolute;
  left: -8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--oeuk-navy-950);
}
.oeuk-ei-pass-stub::before { top: -8px; }
.oeuk-ei-pass-stub::after { bottom: -8px; }

/* Plain rotated text rather than writing-mode:vertical-rl -- html2canvas
   (used to generate the downloadable/emailed pass image) doesn't reliably
   support vertical writing modes, which was rendering this upside down in
   the captured PNG even though it looked correct in the live browser. A
   2D transform on normal horizontal text renders identically in both. */
.oeuk-ei-stub-admit {
  position: absolute;
  top: 44%;
  left: 50%;
  width: 92px;
  text-align: center;
  transform: translate(-50%, -50%) rotate(-90deg);
  white-space: nowrap;
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--oeuk-teal);
}
.oeuk-ei-stub-monogram {
  font-family: Georgia, serif;
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: #E9E2CC;
  opacity: 0.6;
}

.oeuk-ei-reset {
  all: unset;
  display: block;
  width: fit-content;
  margin: 0.9rem auto 0;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(30,27,18,0.35);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.oeuk-ei-wrap:has(.oeuk-ei-scene.is-open) .oeuk-ei-reset {
  opacity: 1;
  pointer-events: auto;
}
.oeuk-ei-reset:hover { color: var(--oeuk-teal); }
.oeuk-ei-reset:focus-visible { outline: 1px solid var(--oeuk-teal); outline-offset: 3px; }

/* ---- landscape / two-column layout from tablet width up ---- */
@media (min-width: 641px) {
  .oeuk-ei-scene { width: min(840px, 100%); }
  .oeuk-ei-envelope-btn { width: min(460px, 100%); }

  .oeuk-ei-pass-body {
    grid-template-columns: 1.05fr 1fr;
  }
  .oeuk-ei-pass-form {
    border-top: none;
    border-left: 1px dashed rgba(30,27,18,0.18);
  }
}

@media (max-width: 640px) {
  .oeuk-ei-pass-stub { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .oeuk-ei-flap, .oeuk-ei-envelope-btn, .oeuk-ei-pass-wrap, .oeuk-ei-seal-half {
    transition-duration: 0.01ms !important;
  }
}
