/* ════════════════════════════════════════════════════
   M-PERKS — sign-in screen (login.php)

   Self-contained on purpose: the page loads this sheet and nothing from
   mperks.css, so the old two-panel .auth rules can never leak in. Every class
   is prefixed `mpl-`.

   LAYOUT — two compositions, chosen by space rather than device name:

     side    Wide landscape screens (≥ 900px wide, wider than tall). The card
             is centred and the mascot stands bottom-left of the viewport,
             overlapping the card's corner by --mpl-overlap, as in the
             reference artwork.

     stack   Phones, portrait tablets, narrow windows. The mascot sits under
             the card, overlapping its bottom-left corner; the card reserves
             a strip at the bottom so the mascot never covers a control.

   MOTION — transforms and opacity only, so everything stays on the
   compositor. The card's glow "breathes" by fading a pre-drawn shadow layer
   rather than animating box-shadow, which would repaint every frame.
   prefers-reduced-motion switches all of it off.
   ════════════════════════════════════════════════════ */

:root {
  --mpl-bg:        #000;
  --mpl-card-bg:   rgba(4, 4, 4, .86);
  --mpl-orange:    #ef7a1c;
  --mpl-orange-hi: #f6a148;
  --mpl-label:     #f5a640;
  --mpl-text:      #fff;
  --mpl-muted:     rgba(255, 255, 255, .62);
  --mpl-danger:    #ff8f7a;

  --mpl-ease:      cubic-bezier(.22, .8, .24, 1);
  --mpl-card-w:    min(560px, 100vw - 32px);
  --mpl-field-w:   360px;
  --mpl-radius:    clamp(20px, 3vw, 28px);
  --mpl-ctl-r:     14px;
  --mpl-ctl-h:     56px;

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body.mpl {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--mpl-bg);
  color: var(--mpl-text);
  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

.mpl svg { flex-shrink: 0; }

.mpl-sr {
  position: absolute !important;
  width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── Sky ─────────────────────────────────────────────────────────────── */
.mpl-sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
  pointer-events: none;
  /* Stars fade in once painted, so a slow first frame is never a pop. */
  opacity: 0;
  transition: opacity 1.2s ease;
}
.mpl-sky.is-ready { opacity: 1; }

/* A soft warm bloom behind the card — the light the glowing frame casts. */
.mpl::before {
  content: "";
  position: fixed;
  left: 50%;
  top: 50%;
  width: min(1100px, 160vw);
  aspect-ratio: 1.4;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(239, 122, 28, .13), rgba(239, 122, 28, .04) 55%, transparent);
  pointer-events: none;
  z-index: 0;
}

/* ── Stage ───────────────────────────────────────────────────────────── */
.mpl-stage {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding:
    max(clamp(16px, 4vh, 48px), env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    max(clamp(16px, 4vh, 48px), env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
}

/* ── Card ────────────────────────────────────────────────────────────── */
.mpl-card {
  position: relative;
  z-index: 2;
  width: var(--mpl-card-w);
  padding: clamp(32px, 6.5vh, 64px) clamp(20px, 6vw, 56px) clamp(28px, 5vh, 48px);
  border: 2px solid var(--mpl-orange);
  border-radius: var(--mpl-radius);
  background: var(--mpl-card-bg);
  text-align: center;
  container-type: inline-size;
  box-shadow:
    inset 0 0 28px rgba(239, 122, 28, .14),
    0 0 18px rgba(239, 122, 28, .45);
  animation: mpl-rise .9s var(--mpl-ease) both;
}

/* The outer glow, drawn once and faded in and out. */
.mpl-card::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  pointer-events: none;
  z-index: -1;
  box-shadow:
    0 0 40px 6px rgba(239, 122, 28, .38),
    0 0 110px 26px rgba(239, 122, 28, .20),
    0 0 220px 60px rgba(239, 122, 28, .08);
  opacity: .75;
  animation: mpl-breathe 5.5s ease-in-out 1s infinite;
  will-change: opacity;
}

/* Brighter rim along the top edge, like the reference frame. */
.mpl-card::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 2px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 196, 120, .85), rgba(255, 196, 120, 0) 40%, rgba(255, 150, 60, 0) 70%, rgba(255, 150, 60, .5));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: .55;
}

/* Staggered entrance for the card's contents. */
.mpl-reveal {
  animation: mpl-fade-up .7s var(--mpl-ease) both;
  animation-delay: calc(var(--d, 0) * 70ms + 280ms);
}

/* ── Header ──────────────────────────────────────────────────────────── */
.mpl-head { margin: 0 0 clamp(20px, 4vh, 36px); }

.mpl-spaced {
  margin: 0;
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
  /* letter-spacing also trails the last glyph; pull it back so the line
     stays optically centred. */
  margin-right: calc(-1 * var(--ls));
  letter-spacing: var(--ls);
}

.mpl-welcome {
  --ls: .55em;
  font-size: clamp(11px, 2.9cqi, 15px);
}

.mpl-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .12em;
  margin: .35em 0 .4em;
  font-size: clamp(19px, 7.3cqi, 38px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.01em;
  text-transform: uppercase;
  white-space: nowrap;
}

.mpl-mono {
  display: inline-grid;
  place-items: center;
  width: 1.32em;
  height: 1.32em;
  margin-right: .02em;
  border: 1.5px solid #c9751f;
  color: var(--mpl-orange);
  font-weight: 300;
  font-size: 1em;
  line-height: 1;
}
.mpl-dash { color: var(--mpl-orange); margin-right: .04em; }

.mpl-tagline {
  --ls: .38em;
  font-size: clamp(10px, 2.55cqi, 13.5px);
}

/* ── Alerts ──────────────────────────────────────────────────────────── */
.mpl-alert {
  max-width: var(--mpl-field-w);
  margin: 0 auto 14px;
  padding: 10px 14px;
  border: 1px solid rgba(239, 122, 28, .45);
  border-radius: 12px;
  background: rgba(239, 122, 28, .08);
  color: #ffe2c4;
  font-size: 13.5px;
  line-height: 1.45;
  text-align: center;
  animation: mpl-fade-up .5s var(--mpl-ease) both;
}
.mpl-alert--danger  { border-color: rgba(255, 110, 90, .55); background: rgba(255, 80, 60, .1); color: #ffd6cf; }
.mpl-alert--success { border-color: rgba(120, 220, 150, .45); background: rgba(80, 200, 120, .08); color: #d5f7df; }
.mpl-alert a { color: inherit; text-decoration: underline; }

/* ── Form ────────────────────────────────────────────────────────────── */
.mpl-form {
  max-width: var(--mpl-field-w);
  margin: 0 auto;
  display: grid;
  gap: clamp(12px, 2.2vh, 18px);
}

.mpl-field { display: grid; gap: 8px; }

.mpl-label {
  color: var(--mpl-label);
  font-size: clamp(12.5px, 3.1cqi, 15px);
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  text-shadow: 0 0 14px rgba(245, 166, 64, .35);
}

.mpl-control { position: relative; }

.mpl-input {
  display: block;
  width: 100%;
  height: var(--mpl-ctl-h);
  padding: 0 52px;
  border: 2px solid #ee8f38;
  border-radius: var(--mpl-ctl-r);
  background: #070605;
  color: var(--mpl-text);
  font: inherit;
  font-size: 16px;            /* 16px stops iOS zooming on focus */
  font-weight: 600;
  letter-spacing: .04em;
  text-align: center;
  caret-color: var(--mpl-orange-hi);
  box-shadow: inset 0 0 16px rgba(239, 122, 28, .14);
  transition: border-color .25s ease, box-shadow .25s ease, background-color .25s ease;
  -webkit-appearance: none;
  appearance: none;
}
.mpl-input::placeholder { color: rgba(255, 255, 255, .28); font-weight: 500; letter-spacing: .02em; }
.mpl-input:hover { border-color: var(--mpl-orange-hi); }
.mpl-input:focus {
  outline: none;
  border-color: #ffb565;
  background: #0b0805;
  box-shadow:
    inset 0 0 18px rgba(239, 122, 28, .2),
    0 0 0 4px rgba(239, 122, 28, .18),
    0 0 26px rgba(239, 122, 28, .35);
}
.mpl-input[type="password"] { letter-spacing: .18em; }
.mpl-input[type="password"]::placeholder { letter-spacing: .02em; }

/* Browser autofill would otherwise paint the field pale yellow. */
.mpl-input:-webkit-autofill,
.mpl-input:-webkit-autofill:hover,
.mpl-input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--mpl-text);
  -webkit-box-shadow: inset 0 0 0 100px #0b0805;
  transition: background-color 9999s;
}

.mpl-icon,
.mpl-eye {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  color: rgba(245, 166, 64, .75);
}
.mpl-icon { left: 18px; pointer-events: none; transition: color .25s ease; }
.mpl-control:focus-within .mpl-icon { color: #ffc27a; }

.mpl-eye {
  right: 8px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  transition: color .2s ease, background-color .2s ease;
}
.mpl-eye:hover { color: #ffc27a; background: rgba(239, 122, 28, .12); }
.mpl-eye:focus-visible { outline: 2px solid var(--mpl-orange-hi); outline-offset: 1px; }
.mpl-eye[aria-pressed="true"] { color: #ffc27a; }

/* ── Primary button ──────────────────────────────────────────────────── */
.mpl-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  height: calc(var(--mpl-ctl-h) + 4px);
  margin-top: 4px;
  padding: 0 16px;
  overflow: hidden;
  border: 0;
  border-radius: var(--mpl-ctl-r);
  background: linear-gradient(180deg, #f39a4c 0%, #e8721a 52%, #ee9a3e 100%);
  color: #fff;
  font: inherit;
  font-size: clamp(16px, 4.4cqi, 21px);
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow:
    inset 0 2px 10px rgba(255, 232, 198, .6),
    inset 0 -3px 8px rgba(255, 210, 140, .45),
    0 10px 30px rgba(239, 122, 28, .28);
  transition: transform .25s var(--mpl-ease), box-shadow .25s ease, filter .25s ease;
  -webkit-tap-highlight-color: transparent;
}
.mpl-btn__text {
  letter-spacing: .62em;
  margin-right: -.62em;
}
.mpl-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow:
    inset 0 2px 10px rgba(255, 232, 198, .65),
    inset 0 -3px 8px rgba(255, 210, 140, .5),
    0 16px 38px rgba(239, 122, 28, .42);
}
.mpl-btn:active { transform: translateY(0) scale(.985); }
.mpl-btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* A slow light sweep across the button. */
.mpl-btn::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent);
  transform: translateX(-160%) skewX(-20deg);
  animation: mpl-shine 6s ease-in-out 2.2s infinite;
  pointer-events: none;
}

.mpl-rocket {
  display: grid;
  place-items: center;
  transition: transform .35s var(--mpl-ease);
}
.mpl-btn:hover .mpl-rocket { transform: translate3d(3px, -3px, 0) rotate(-6deg); }

/* Status copy ("Welcome aboard") is longer than LOGIN; tighter tracking. */
.mpl-btn.is-status .mpl-btn__text { letter-spacing: .16em; margin-right: -.16em; }
.mpl-btn.is-status { gap: 0; }
.mpl-btn.is-status .mpl-rocket { display: none; }

/* Submitted: the rocket launches while the browser navigates. */
.mpl-btn.is-launching { pointer-events: none; }
.mpl-btn.is-launching .mpl-rocket { animation: mpl-launch .9s cubic-bezier(.5, 0, .75, 0) forwards; }
.mpl-btn.is-launching::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 120%, rgba(255, 240, 210, .45), transparent 60%);
  animation: mpl-fade-in .5s ease both;
}

.mpl-promise {
  --ls: .14em;
  margin-top: clamp(14px, 2.4vh, 20px);
  font-size: clamp(10px, 2.5cqi, 13px);
}

/* ── Lark ────────────────────────────────────────────────────────────── */
.mpl-alt {
  max-width: var(--mpl-field-w);
  margin: clamp(18px, 3vh, 26px) auto 0;
}

.mpl-sep {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: clamp(12px, 2.2vh, 18px);
  color: var(--mpl-muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .3em;
  text-transform: uppercase;
}
.mpl-sep::before,
.mpl-sep::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(239, 122, 28, .55));
}
.mpl-sep::after { transform: scaleX(-1); }

.mpl-lark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 1.5px solid rgba(239, 122, 28, .55);
  border-radius: var(--mpl-ctl-r);
  background: rgba(255, 255, 255, .03);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .02em;
  text-decoration: none;
  transition: border-color .25s ease, background-color .25s ease, transform .25s var(--mpl-ease), box-shadow .25s ease;
  -webkit-tap-highlight-color: transparent;
}
.mpl-lark svg { color: var(--mpl-orange-hi); transition: transform .3s var(--mpl-ease); }
.mpl-lark:hover {
  border-color: var(--mpl-orange-hi);
  background: rgba(239, 122, 28, .1);
  transform: translateY(-1px);
  box-shadow: 0 8px 26px rgba(239, 122, 28, .18);
}
.mpl-lark:hover svg { transform: translateX(3px); }
.mpl-lark:focus-visible { outline: 2px solid var(--mpl-orange-hi); outline-offset: 3px; }

/* Clicked: the icon lifts off like the LOGIN rocket while the browser
   heads to Lark. Signed in: "Welcome aboard!" alone, as on LOGIN. */
.mpl-lark.is-launching,
.mpl-lark.is-status { pointer-events: none; border-color: var(--mpl-orange-hi); background: rgba(239, 122, 28, .1); }
.mpl-lark.is-launching { overflow: hidden; }
.mpl-lark.is-launching svg { animation: mpl-launch .9s cubic-bezier(.5, 0, .75, 0) forwards; }
.mpl-lark.is-status svg { display: none; }
.mpl-lark.is-status .mpl-lark__text { letter-spacing: .16em; text-transform: uppercase; }

.mpl-help {
  margin: 14px 0 0;
  color: var(--mpl-muted);
  font-size: 12.5px;
}
.mpl-help a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #ffc07a;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, color .2s ease;
}
.mpl-help a:hover { color: #ffd6a3; border-bottom-color: currentColor; }
.mpl-help a:focus-visible { outline: 2px solid var(--mpl-orange-hi); outline-offset: 3px; border-radius: 4px; }

/* ── QR view ─────────────────────────────────────────────────────────── */
.mpl-qr { max-width: var(--mpl-field-w); margin: 0 auto; }
.mpl-qr__frame {
  display: inline-grid;
  place-items: center;
  width: 248px;
  max-width: 100%;
  aspect-ratio: 1;
  padding: 12px;
  border: 2px solid #ee8f38;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 0 30px rgba(239, 122, 28, .3);
}
.mpl-qr__frame iframe { max-width: 100%; }
.mpl-qr__hint { margin: 14px 0 18px; color: var(--mpl-muted); font-size: 13px; }
.mpl-qr__hint b { color: #fff; }

/* ── Mascot ──────────────────────────────────────────────────────────────
   Four layers, one transform each, so no animation ever fights another:

     .mpl-mascot          where it stands, and the entrance
       __lift             sizing only (the stacked layout narrows it)
         __body           holds the still and the animation (no idle motion)
           picture/img    the still (shown first, always)
           __anim         the animated launch WebP, laid exactly over the
                          still. Its first frame IS the still, so the swap
                          is invisible. */
.mpl-mascot {
  --mpl-m-w: clamp(180px, min(25vw, 46vh), 430px);
  --mpl-overlap: 34px;
  position: fixed;
  z-index: 3;
  bottom: 0;
  left: calc(50% - var(--mpl-card-w) / 2 - var(--mpl-m-w) + var(--mpl-overlap));
  width: var(--mpl-m-w);
  margin: 0;
  pointer-events: none;
  animation: mpl-mascot-in 1.1s var(--mpl-ease) .45s both;
}
.mpl-mascot__lift {
  position: relative;
  width: 100%;
}
.mpl-mascot__body {
  position: relative;
  width: 100%;
}
.mpl-mascot__body img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 18px 40px rgba(239, 122, 28, .18));
  -webkit-user-drag: none;
  user-select: none;
}
.mpl-mascot__still { display: block; }
.mpl-mascot__anim {
  position: absolute;
  inset: 0;
  opacity: 0;
}

/* Launch: the animated WebP takes over from the still. */
.mpl.is-launch .mpl-mascot__anim { opacity: 1; }
.mpl.is-launch .mpl-mascot__still { opacity: 0; }

/* As in m-perks-ui, nothing else in the scene moves while he plays: the
   card stays exactly where it is, and the next screen takes over the moment
   his last frame lands (see the view transition at the end of this file). */

/* Once the entrance has played it is dropped, so the shake and the
   other card states are not overridden by its held end frame. A wrong
   password gets a short, damped shake. */
.mpl-card.is-settled { animation: none; }
.mpl-card.is-settled.is-shake { animation: mpl-shake .5s cubic-bezier(.36, .07, .19, .97) both; }

/* ── Stack composition: phones, portrait tablets, narrow windows ─────── */
@media (max-width: 899.98px), (max-aspect-ratio: 1/1) {
  :root { --mpl-card-w: min(520px, 100vw - 32px); }

  .mpl-stage { justify-content: center; }

  .mpl-card {
    /* The strip the mascot overlaps; nothing interactive lives here. */
    padding-bottom: calc(clamp(28px, 5vh, 48px) + var(--mpl-m-overlap));
    --mpl-m-overlap: clamp(46px, 13vw, 76px);
  }

  .mpl-mascot {
    --mpl-m-w: clamp(130px, 38vw, 210px);
    position: relative;
    left: auto;
    bottom: auto;
    align-self: center;
    width: var(--mpl-card-w);
    margin-top: calc(-1 * clamp(46px, 13vw, 76px));
    margin-bottom: calc(-1 * clamp(16px, 4vh, 48px));
  }
  .mpl-mascot__lift {
    width: var(--mpl-m-w);
    margin-left: -6px;
  }
}

/* Short landscape windows (laptops with toolbars, phones on their side):
   tighten the vertical rhythm before anything has to scroll. */
@media (max-height: 760px) and (min-aspect-ratio: 1/1) {
  :root { --mpl-ctl-h: 50px; }
  .mpl-card { padding-top: clamp(24px, 4.5vh, 40px); padding-bottom: clamp(22px, 4vh, 36px); }
  .mpl-head { margin-bottom: clamp(14px, 2.6vh, 24px); }
  .mpl-field { gap: 6px; }
  .mpl-lark { min-height: 46px; }
}
@media (max-height: 680px) and (min-aspect-ratio: 1/1) {
  :root { --mpl-ctl-h: 46px; }
  .mpl-head { margin-bottom: 12px; }
  .mpl-form { gap: 10px; }
  .mpl-promise { margin-top: 10px; }
  .mpl-alt { margin-top: 12px; }
  .mpl-sep { margin-bottom: 8px; }
  .mpl-lark { min-height: 42px; }
  .mpl-help { margin-top: 8px; }
}

/* Phone held sideways: the stack layout would put the mascot below the
   fold, so tuck it beside the card at a smaller size instead. */
@media (max-height: 520px) and (min-aspect-ratio: 1/1) {
  :root { --mpl-card-w: min(500px, 100vw - 32px); }
  .mpl-card { padding-bottom: clamp(22px, 4vh, 36px); }
  .mpl-mascot {
    --mpl-m-w: clamp(110px, 22vw, 200px);
    position: fixed;
    left: max(-10px, calc(50% - var(--mpl-card-w) / 2 - var(--mpl-m-w) + 18px));
    bottom: 0;
    width: var(--mpl-m-w);
    margin: 0;
  }
  .mpl-mascot__lift { width: 100%; margin: 0; }
}

/* Phones: a tighter vertical rhythm so the card and mascot share one screen. */
@media (max-width: 480px) {
  :root { --mpl-ctl-h: 50px; }
  .mpl-card { padding-top: 26px; }
  .mpl-head { margin-bottom: 18px; }
  .mpl-form { gap: 10px; }
  .mpl-field { gap: 6px; }
  .mpl-promise { margin-top: 12px; }
  .mpl-alt { margin-top: 14px; }
  .mpl-sep { margin-bottom: 10px; }
  .mpl-lark { min-height: 46px; }
  .mpl-help { margin-top: 10px; }
}

/* Very small phones. */
@media (max-width: 360px) {
  :root { --mpl-ctl-h: 50px; --mpl-ctl-r: 12px; }
  .mpl-input { padding: 0 46px; }
  .mpl-icon { left: 14px; }
  .mpl-btn { gap: 10px; }
  /* The tagline is nowrap; at its full tracking it ran into the card edge
     at 320px. */
  .mpl-tagline { --ls: .2em; }
}

/* Large monitors: let the composition grow with the screen. */
@media (min-width: 1800px) and (min-height: 950px) {
  :root { --mpl-card-w: 620px; --mpl-field-w: 390px; --mpl-ctl-h: 60px; }
  .mpl-mascot { --mpl-m-w: clamp(380px, 24vw, 520px); }
}

/* ── Lark auto sign-in overlay ───────────────────────────────────────── */
.mpl-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 24px;
  background: rgba(0, 0, 0, .9);
  text-align: center;
  animation: mpl-fade-in .35s ease both;
}
.mpl-overlay[hidden] { display: none; }
.mpl-overlay .mpl-brand { font-size: clamp(20px, 6vw, 30px); }
.mpl-spinner {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 3px solid rgba(239, 122, 28, .2);
  border-top-color: var(--mpl-orange-hi);
  animation: mpl-spin .9s linear infinite;
}
.mpl-overlay__copy { display: grid; gap: 4px; max-width: 320px; }
.mpl-overlay__copy span { color: var(--mpl-muted); font-size: 14px; }
.mpl-overlay__cancel { color: #ffc07a; font-size: 14px; font-weight: 600; }

/* ── Keyframes ───────────────────────────────────────────────────────── */
@keyframes mpl-rise {
  from { opacity: 0; transform: translate3d(0, 28px, 0) scale(.965); }
  to   { opacity: 1; transform: none; }
}
@keyframes mpl-fade-up {
  from { opacity: 0; transform: translate3d(0, 12px, 0); }
  to   { opacity: 1; transform: none; }
}
@keyframes mpl-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes mpl-breathe {
  0%, 100% { opacity: .7; }
  50%      { opacity: 1; }
}
/* He fades in where he stands; he never slides or floats. */
@keyframes mpl-mascot-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes mpl-shine {
  0%       { transform: translateX(-160%) skewX(-20deg); }
  45%, 100% { transform: translateX(360%) skewX(-20deg); }
}
@keyframes mpl-launch {
  0%   { transform: translate3d(0, 0, 0) rotate(0); opacity: 1; }
  25%  { transform: translate3d(-2px, 2px, 0) rotate(4deg); opacity: 1; }
  100% { transform: translate3d(90px, -90px, 0) rotate(-8deg); opacity: 0; }
}
@keyframes mpl-spin { to { transform: rotate(360deg); } }
@keyframes mpl-shake {
  10%, 90% { transform: translate3d(-2px, 0, 0); }
  20%, 80% { transform: translate3d(4px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-7px, 0, 0); }
  40%, 60% { transform: translate3d(7px, 0, 0); }
}

/* ── Reduced motion ──────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .mpl *,
  .mpl *::before,
  .mpl *::after {
    animation: none !important;
    transition-duration: .01ms !important;
  }
  .mpl-spinner { animation: mpl-spin 2.4s linear infinite !important; }
}

/* ── Page hand-off ─────────────────────────────────────────────────────
   m-perks-ui swaps the login for the post-login screen without a page load.
   A cross-document view transition gives the same seamless hand-off here:
   the browser cross-fades the two pages instead of flashing between them.
   perks-orange.css opts the home screen in too, which the browser needs on
   both sides. Browsers without it simply navigate. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root),
  ::view-transition-new(root) { animation-duration: .45s; animation-timing-function: ease; }
}
