/* BMD sign-in pages, v42: a 3D stage beside the form. The stage is a dark rounded panel where auth3d.js draws the
   logo; the form sits on the same light canvas as the dashboards. Loaded after site.css on the client sign-in,
   sign-up and link pages and on the team sign-in. Every form, id and message is unchanged. */

body.a3-page {
  --a3-ink: #0b1a30;
  --a3-ink-2: #44546c;
  --a3-ink-3: #66758c;
  --a3-head: Inter, 'Segoe UI', system-ui, -apple-system, sans-serif;
  --a3-ease: cubic-bezier(.16, 1, .3, 1);
  background: #edf1f7;
}
.auth.a3 {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(440px, 1fr); place-items: stretch;
  min-height: 100vh; min-height: 100svh; padding: 0;
  background:
    radial-gradient(900px 600px at 100% 0%, rgba(34, 184, 240, .10), transparent 60%),
    radial-gradient(700px 600px at 60% 100%, rgba(0, 87, 255, .07), transparent 60%),
    #edf1f7;
}
.auth.a3::before, .auth.a3::after { display: none; }

/* ------------------------------------------------------------------ the stage */
.a3-stage {
  --px: 0; --py: 0;
  position: sticky; top: 16px; align-self: start;
  height: calc(100vh - 32px); height: calc(100svh - 32px); min-height: 520px;
  margin: 16px 0 16px 16px; border-radius: 32px; overflow: hidden; isolation: isolate;
  background:
    radial-gradient(60% 46% at 50% 44%, rgba(0, 87, 255, .38), transparent 72%),
    radial-gradient(40% 36% at 86% 6%, rgba(97, 215, 247, .20), transparent 70%),
    radial-gradient(50% 40% at 6% 100%, rgba(216, 188, 126, .10), transparent 70%),
    linear-gradient(180deg, #0b2142 0%, #061529 58%, #030c1a 100%);
  box-shadow: 0 40px 80px -40px rgba(3, 12, 26, .7), inset 0 1px 0 rgba(255, 255, 255, .08);
}
.a3-stage::before {   /* a faint grid, until the 3D floor takes over */
  content: ''; position: absolute; inset: 0; z-index: -1; opacity: .5;
  background-image: linear-gradient(rgba(140, 200, 255, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(140, 200, 255, .06) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(70% 60% at 50% 70%, #000, transparent 75%);
  -webkit-mask-image: radial-gradient(70% 60% at 50% 70%, #000, transparent 75%);
  transition: opacity 1.2s;
}
.a3-live .a3-stage::before { opacity: 0; }
.a3-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity .9s ease; }
.a3-live .a3-canvas { opacity: 1; }
/* the still picture: no WebGL, data saving, or less motion asked for */
.a3-still .a3-stage::after {
  content: ''; position: absolute; inset: 0; z-index: 0;
  background: url('/assets/img/auth/poster-0183e1fceb6e.webp') center / cover no-repeat;
}
@media (prefers-reduced-motion: reduce) {
  .a3-stage::after {
    content: ''; position: absolute; inset: 0; z-index: 0;
    background: url('/assets/img/auth/poster-0183e1fceb6e.webp') center / cover no-repeat;
  }
}

/* glass cards floating over the scene */
@keyframes a3-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -9px; } }
@keyframes a3-in { from { opacity: 0; transform: translate3d(0, 18px, 0) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes a3-chip-in { from { opacity: 0; scale: .9; } to { opacity: 1; scale: 1; } }   /* scale, so the pointer's transform still applies */
.a3-chip {
  position: absolute; z-index: 2;
  display: flex; align-items: center; gap: 11px; padding: 10px 16px 10px 10px;
  border-radius: 18px; border: 1px solid rgba(255, 255, 255, .14);
  background: linear-gradient(135deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .05));
  backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 24px 50px -24px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .18);
  color: #fff; font: 600 13.5px/1.25 var(--a3-head); letter-spacing: -.1px; white-space: nowrap;
  animation: a3-chip-in 1s var(--a3-ease) both, a3-float 6s ease-in-out infinite;
}
.a3-chip__icon {
  width: 34px; height: 34px; border-radius: 11px; flex-shrink: 0; display: grid; place-items: center;
  background: linear-gradient(135deg, #0057ff, #2fb7f5); box-shadow: 0 8px 18px -8px rgba(0, 120, 255, .9);
}
.a3-chip__icon svg { width: 17px; height: 17px; }
.a3-chip--1 { top: 13%; left: 7%; animation-delay: 1.6s, 0s; transform: translate3d(calc(var(--px) * -18px), calc(var(--py) * -12px), 0); }
.a3-chip--2 { top: 21%; right: 6%; animation-delay: 1.75s, -2s; transform: translate3d(calc(var(--px) * -28px), calc(var(--py) * -18px), 0); }
.a3-chip--3 { bottom: 15%; left: 11%; animation-delay: 1.9s, -4s; transform: translate3d(calc(var(--px) * -36px), calc(var(--py) * -22px), 0); }
.a3-chip--2 .a3-chip__icon { background: linear-gradient(135deg, #2fb7f5, #61d7f7); }
.a3-chip--3 .a3-chip__icon { background: linear-gradient(135deg, #c79a3e, #e8cc8d); box-shadow: 0 8px 18px -8px rgba(216, 188, 126, .9); }
.a3-chip { transition: transform .5s var(--a3-ease); }

/* ------------------------------------------------------------------ the form side */
.auth.a3 .auth__inner { align-self: center; justify-self: center; width: 100%; max-width: 456px; padding: 48px 28px; }
.auth.a3 .auth__head { text-align: left; margin-bottom: 26px; }
.auth.a3 .auth__head img { height: 38px; width: auto; margin: 0 0 30px; }
.auth.a3 .auth__head .eyebrow {
  display: inline-flex; align-items: center; height: 28px; padding: 0 12px; margin-bottom: 14px; border-radius: 999px;
  background: rgba(0, 87, 255, .1); color: #0047d6; font: 700 11.5px/1 var(--a3-head); letter-spacing: .06em; text-transform: uppercase;
}
.auth.a3 .auth__head .eyebrow::before { display: none; }
.auth.a3 .auth__head h1 {
  font-family: var(--a3-head); font-size: clamp(30px, 2.8vw, 38px); font-weight: 700; letter-spacing: -1.2px;
  line-height: 1.12; color: var(--a3-ink); margin-bottom: 8px;
}
.auth.a3 .auth__head p { font-size: 15px; color: var(--a3-ink-2); }
.auth.a3 .auth__card {
  border-radius: 26px; padding: 30px;
  box-shadow: 0 1px 2px rgba(11, 26, 48, .04), 0 30px 60px -30px rgba(11, 40, 90, .30);
  animation: a3-in .8s var(--a3-ease) .1s both;
}
.auth.a3 .auth__card label { font: 600 13.5px/1.3 var(--a3-head); letter-spacing: 0; text-transform: none; color: var(--a3-ink); }
.auth.a3 .auth__card label .u-plain { font-weight: 400; color: var(--a3-ink-3); }
.auth.a3 .auth__card input:not([type="checkbox"]):not([type="radio"]), .auth.a3 .auth__card select {
  min-height: 50px; border-radius: 14px; border: 1px solid #d6e0ec; background: #f7f9fc; font-size: 15px;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.auth.a3 .auth__card input:not([type="checkbox"]):not([type="radio"]):hover, .auth.a3 .auth__card select:hover { border-color: #b9c8dc; }
.auth.a3 .auth__card input:not([type="checkbox"]):not([type="radio"]):focus, .auth.a3 .auth__card select:focus {
  outline: none; border-color: #0057ff; background: #fff; box-shadow: 0 0 0 4px rgba(0, 87, 255, .14);
}
.auth.a3 .auth__card .btn--primary {
  min-height: 52px; border-radius: 14px; border: 0;
  background: linear-gradient(135deg, #0057ff 0%, #2f7bff 100%);
  box-shadow: 0 14px 28px -14px rgba(0, 87, 255, .95), inset 0 1px 0 rgba(255, 255, 255, .25);
  font: 650 15px/1 var(--a3-head); letter-spacing: 0; text-transform: none;
}
.auth.a3 .auth__card .btn--primary:hover { background: linear-gradient(135deg, #0047d6 0%, #0057ff 100%); }
.auth.a3 .auth__foot { border-top-color: #e4eaf2; color: var(--a3-ink-2); }
.auth.a3 .auth__back { text-align: left; color: var(--a3-ink-3); font-family: var(--a3-head); letter-spacing: .02em; text-transform: none; font-size: 13px; }
.auth.a3 .auth__back:hover { color: #0047d6; }
.auth.a3 .page-foot, .auth.a3 footer.auth__foot { border: 0; padding: 0; margin: 0; text-align: left; }

/* ------------------------------------------------------------------ phones and small windows: the stage on top */
@media (max-width: 960px) {
  .auth.a3 { grid-template-columns: 1fr; place-items: start stretch; }
  .a3-stage { position: relative; top: auto; height: clamp(260px, 42vh, 360px); min-height: 0; margin: 10px 10px 0; border-radius: 28px; }
  .a3-chip { display: none; }
  .auth.a3 .auth__inner { padding: 22px 18px 36px; max-width: 520px; }
  .auth.a3 .auth__head { margin-bottom: 18px; }
  .auth.a3 .auth__head > a { display: none; }   /* the 3D logo above already says who we are */
  .auth.a3 .auth__head h1 { font-size: 28px; }
  .auth.a3 .auth__card { padding: 22px 18px; border-radius: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .a3-chip, .auth.a3 .auth__card { animation: none !important; }
  .a3-canvas { display: none; }
}
