/* Full-height photo split login: photos fill the viewport's LEFT side
   edge-to-edge (whole-page canvas, no chrome); the login form sits in a
   solid right-hand rail so the photography — pictures of people — is never
   covered by UI. Loaded only by registration/login_photo.html.
   The rail keeps the card's normal Tabler styling untouched. */

html, body { height: 100%; }
body.login-photo-page {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(400px, 34%);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #f6f8fb;
}

/* --- photo canvas (left, full height) --- */
.photo-stage {
  position: relative;
  overflow: hidden;
  background: #14202e; /* behind the first image while it loads */
}
.login-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.4s ease;
}
.login-slide.on { opacity: 1; }
.login-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* --- photo motion (gallery_photo_motion setting) ---
   One motion idea per surface, applied via a motion-<value> class on the
   stage; cycle length comes from --gallery-motion-dur (AppSettings). */
.photo-stage { --plx-x: 0px; --plx-y: 0px; }

@keyframes login-kb-in  { from { transform: scale(1); }    to { transform: scale(1.08); } }
@keyframes login-kb-out { from { transform: scale(1.08); } to { transform: scale(1); } }
@keyframes login-pan {
  from { transform: scale(1.07) translate(1.5%, 0.8%); }
  to   { transform: scale(1.11) translate(-1.5%, -0.8%); }
}
@keyframes login-settle { from { transform: scale(1.07); } to { transform: scale(1); } }
@keyframes login-breathe { from { transform: scale(1); } to { transform: scale(1.035); } }

/* zoom: alternate direction per slide so consecutive photos vary the move */
.motion-zoom .login-slide.on img {
  animation: login-kb-in var(--gallery-motion-dur, 8s) ease-in-out infinite alternate;
}
.motion-zoom .login-slide.on:nth-child(even) img { animation-name: login-kb-out; }

.motion-pan_zoom .login-slide.on img {
  animation: login-pan var(--gallery-motion-dur, 8s) ease-in-out infinite alternate;
}

/* settle: one-shot landing each time a slide becomes active, then still */
.motion-settle .login-slide.on img {
  animation: login-settle calc(var(--gallery-motion-dur, 8s) / 3)
             cubic-bezier(0.22, 0.61, 0.36, 1) 1 forwards;
}

/* parallax: JS feeds --plx-x/--plx-y from pointer position */
.motion-parallax .login-slide img {
  transform: scale(1.06) translate(var(--plx-x), var(--plx-y));
  transition: transform 0.9s cubic-bezier(0.2, 0.6, 0.3, 1);
}

/* Caption legibility only — a low bottom grade so faces stay clear */
.photo-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 12, 18, 0) 62%, rgba(8, 12, 18, 0.55) 100%);
  pointer-events: none;
}

/* --- living collage (mode: collage) --- */
.photo-collage {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 58% 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 3px;
  background: #0c1116; /* thin keylines between tiles */
}
.collage-tile { position: relative; overflow: hidden; }
.collage-tile--hero { grid-row: 1 / 3; }
.collage-tile .login-slide { transition: opacity 1.3s ease; }
/* Tiles never run the single-photo motions; with any motion setting other
   than 'none' they breathe instead — tiny, slow, out of phase per tile. */
.collage-tile .login-slide img { animation: none; }
.photo-stage:not(.motion-none) .collage-tile .login-slide.on img {
  animation: login-breathe calc(var(--gallery-motion-dur, 8s) * 2) ease-in-out infinite alternate;
}
.photo-stage:not(.motion-none) .collage-tile:nth-child(2) .login-slide.on img {
  animation-delay: calc(var(--gallery-motion-dur, 8s) * -0.66);
}
.photo-stage:not(.motion-none) .collage-tile:nth-child(3) .login-slide.on img {
  animation-delay: calc(var(--gallery-motion-dur, 8s) * -1.33);
}
.login-lower3--collage { text-align: left; }

/* --- lower-third caption + controls (bottom-left of the photo) --- */
.login-lower3 {
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 22px;
  color: #fff;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
}
.login-tag {
  display: block;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 3px;
}
.login-cap {
  font-size: 16px;
  font-weight: 600;
}
.login-ctrl {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
}
.login-cbtn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(10, 14, 20, 0.35);
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  transition: background 0.2s, border-color 0.2s;
}
.login-cbtn:hover { background: rgba(10, 14, 20, 0.65); border-color: #fff; }
.login-cbtn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.login-cbtn .pp { font-size: 9px; letter-spacing: 1px; }

.login-dashes { display: flex; gap: 2px; }
.login-dashes button {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  width: 22px;
  height: 24px;
  cursor: pointer;
  position: relative;
}
.login-dashes button::after {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  top: 11px;
  height: 2px;
  background: rgba(255, 255, 255, 0.35);
  transition: background 0.4s;
}
.login-dashes button:hover::after { background: rgba(255, 255, 255, 0.7); }
.login-dashes button.on::after { background: #fff; }
.login-dashes button:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }

/* --- login rail (right, solid — never overlaps the photo) --- */
.login-rail {
  background: #f6f8fb;
  border-left: 1px solid #e6e9ee;
  box-shadow: -18px 0 48px rgba(15, 22, 32, 0.10);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  overflow-y: auto;
}
.login-rail-inner {
  width: 100%;
  max-width: 380px;
}

/* --- responsive --- */
@media (max-width: 991.98px) {
  /* NEVER stack (Jack, 2026-07-11): the split is side-by-side or nothing.
     On phones/small tablets the first photo becomes a blurred, dimmed
     full-screen backdrop behind the centred login card (Jack, 2026-07-12)
     — still photographic, but the form owns the focus. */
  body.login-photo-page {
    grid-template-columns: 1fr;
    overflow: auto;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
  }
  .photo-stage {
    position: fixed;
    inset: 0;
    z-index: 0;
  }
  /* First photo only, softened; no rotation, captions, controls or motion
     (!important outranks every motion-<value> rule). */
  .login-slide { display: none; }
  .login-slide:first-child { display: block; opacity: 1; }
  .login-slide img {
    animation: none !important;
    /* No blur — just a slight dim so the card reads clearly (Jack, 2026-07-14). */
    filter: brightness(0.85);
    transform: none !important;
    transition: none !important;
  }
  .photo-collage { display: block; } /* collage collapses to its hero tile */
  .collage-tile { position: absolute; inset: 0; display: none; }
  .collage-tile--hero { display: block; }
  .login-lower3, .photo-scrim { display: none; }
  .photo-stage::after { /* even dim so the card reads on any photo */
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(10, 15, 22, 0.35);
  }

  .login-rail {
    position: relative;
    z-index: 1;
    background: transparent;
    border-left: 0;
    box-shadow: none;
    padding: 32px 20px;
    min-height: 100vh;
    min-height: 100dvh;
  }
  .login-rail .card {
    box-shadow: 0 18px 60px rgba(8, 12, 18, 0.45);
  }
  /* Org heading + "Powered by" sit on the photo — switch to white. */
  .login-rail .text-primary {
    color: #fff !important;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.6);
  }
  .login-rail .text-muted,
  .login-rail .text-muted .small {
    color: rgba(255, 255, 255, 0.88) !important;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.55);
  }
  .login-rail .card .text-muted {
    color: var(--tblr-secondary, #6c7a91) !important;
    text-shadow: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  /* Kill every motion variant + crossfades; static photo swaps only. */
  .photo-stage img, .login-slide {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}
