/* ==========================================================================
   Login page - 2026 refresh
   Self-contained: no CDN, no icon font, no build step.
   Scoped under .pmb-auth so the legacy login_page/css/style.css rules that the
   forgot/pwreset pages still share cannot leak in and break the layout.
   ========================================================================== */

/* Brand display face, served locally so the page works offline. */
@font-face {
  font-family: 'Signika Local';
  src: url('../../fonts/signika/signika-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

.pmb-auth {
  /* palette */
  --pmb-ink:        #05070f;
  --pmb-ink-2:      #0b1020;
  --pmb-surface:    rgba(255, 255, 255, 0.045);
  --pmb-surface-2:  rgba(255, 255, 255, 0.075);
  --pmb-line:       rgba(255, 255, 255, 0.11);
  --pmb-line-2:     rgba(255, 255, 255, 0.2);
  --pmb-text:       #eef2ff;
  --pmb-muted:      rgba(238, 242, 255, 0.62);
  --pmb-faint:      rgba(238, 242, 255, 0.4);
  --pmb-a1:         #5eead4;
  --pmb-a2:         #818cf8;
  --pmb-a3:         #c084fc;
  --pmb-danger:     #fca5a5;
  --pmb-radius:     26px;

  /* type */
  --pmb-ui: system-ui, -apple-system, 'Segoe UI', Inter, Roboto, Helvetica, Arial, sans-serif;
  --pmb-display: 'Signika Local', 'Segoe UI', system-ui, sans-serif;

  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 3vw, 2.5rem);
  box-sizing: border-box;
  font-family: var(--pmb-ui);
  color: var(--pmb-text);
  background: var(--pmb-ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

/* ---------------------------------------------------------------- backdrop */
/* Three stacked school photos cross-fade on a slow loop. Pure CSS, so there is
   no slideshow plugin to load. The heavy scrim + gradient mesh on top keeps
   text legible whatever the photo underneath happens to be. */
.pmb-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 8% 0%,  #131a3a 0%, transparent 55%),
    radial-gradient(110% 80% at 100% 12%, #1a1440 0%, transparent 52%),
    linear-gradient(165deg, #070a18 0%, #0b1024 48%, #070a16 100%);
}

.pmb-backdrop img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  animation: pmbDrift 27s ease-in-out infinite;
  will-change: opacity, transform;
}
.pmb-backdrop img:nth-child(1) { animation-delay: 0s;  }
.pmb-backdrop img:nth-child(2) { animation-delay: 9s;  }
.pmb-backdrop img:nth-child(3) { animation-delay: 18s; }

/* darkening + colour wash so the photo never fights the type */
.pmb-backdrop::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(5, 7, 15, 0.86) 0%, rgba(5, 7, 15, 0.7) 45%, rgba(5, 7, 15, 0.92) 100%),
    radial-gradient(80% 60% at 50% 8%, rgba(129, 140, 248, 0.22) 0%, transparent 70%);
}

/* slow aurora blobs for depth */
.pmb-aurora {
  position: fixed;
  z-index: 0;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  pointer-events: none;
  will-change: transform;
}
.pmb-aurora--a {
  width: 46vmax; height: 46vmax;
  top: -16vmax; left: -12vmax;
  background: radial-gradient(circle, rgba(94, 234, 212, 0.4) 0%, transparent 68%);
  animation: pmbFloat 26s ease-in-out infinite;
}
.pmb-aurora--b {
  width: 40vmax; height: 40vmax;
  bottom: -14vmax; right: -10vmax;
  background: radial-gradient(circle, rgba(192, 132, 252, 0.36) 0%, transparent 68%);
  animation: pmbFloat 32s ease-in-out infinite reverse;
}
.pmb-aurora--c {
  width: 30vmax; height: 30vmax;
  top: 42%; left: 52%;
  background: radial-gradient(circle, rgba(129, 140, 248, 0.34) 0%, transparent 70%);
  animation: pmbFloat 38s ease-in-out infinite;
}

/* ------------------------------------------------------------------- shell */
.pmb-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1060px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  border-radius: var(--pmb-radius);
  overflow: hidden;
  background: var(--pmb-surface);
  border: 1px solid var(--pmb-line);
  box-shadow:
    0 1px 0 0 rgba(255, 255, 255, 0.08) inset,
    0 30px 70px -20px rgba(2, 4, 12, 0.85),
    0 8px 28px -12px rgba(2, 4, 12, 0.7);
  backdrop-filter: blur(26px) saturate(140%);
  -webkit-backdrop-filter: blur(26px) saturate(140%);
}

/* -------------------------------------------------------------- brand side */
.pmb-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  padding: clamp(1.75rem, 3.2vw, 3rem);
  border-right: 1px solid var(--pmb-line);
  background:
    linear-gradient(155deg, rgba(129, 140, 248, 0.16) 0%, rgba(192, 132, 252, 0.07) 45%, transparent 78%);
  overflow: hidden;
}

/* hairline gradient that reads as a light edge along the top */
.pmb-brand::before {
  content: '';
  position: absolute;
  top: 0; left: 8%; right: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
}

.pmb-brand__mark {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

/* The logo is a 329x120 (2.74:1) wordmark, so it is sized by height and allowed
   to take its own width instead of being locked into a square. The near-white
   plate is kept because the artwork itself is a mid-tone olive that would go
   muddy against the dark aurora panel. */
.pmb-brand__logo {
    width: auto;
    height: 44px;
    max-width: 100%;
    flex: 0 0 auto;
    object-fit: contain;
    border-radius: 13px;
    padding: 7px 12px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 10px 26px -10px rgba(2, 4, 12, 0.9);
}


.pmb-brand__eyebrow {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--pmb-faint);
}

.pmb-brand__name {
  font-family: var(--pmb-display);
  font-size: clamp(1.5rem, 2.5vw, 2.1rem);
  font-weight: 600;
  line-height: 1.16;
  letter-spacing: -0.015em;
  margin: 0.9rem 0 0;
  text-wrap: balance;
  background: linear-gradient(135deg, #ffffff 0%, #dbe4ff 55%, #a5b4fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.pmb-brand__rule {
  width: 62px;
  height: 3px;
  margin: 1.35rem 0 0;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--pmb-a1), var(--pmb-a2), var(--pmb-a3));
}

.pmb-brand__tagline {
  margin: 1.15rem 0 0;
  max-width: 34ch;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--pmb-muted);
}

.pmb-brand__list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
}

.pmb-brand__list li {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--pmb-muted);
}

.pmb-brand__list svg {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  color: var(--pmb-a1);
}

.pmb-brand__foot {
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  color: var(--pmb-faint);
}

/* ---------------------------------------------------------------- form side */
.pmb-form {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.75rem, 3.2vw, 3rem);
  background: rgba(255, 255, 255, 0.028);
}

.pmb-form__head { margin-bottom: 1.6rem; }

.pmb-form__hello {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--pmb-a1);
}

.pmb-form__title {
  margin: 0.55rem 0 0;
  font-family: var(--pmb-display);
  font-size: clamp(1.6rem, 2.6vw, 2rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.pmb-form__sub {
  margin: 0.6rem 0 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--pmb-muted);
}

.pmb-form__body { display: flex; flex-direction: column; gap: 1.1rem; }

/* --------------------------------------------------------- floating fields */
.pmb-field { position: relative; }

.pmb-field__input {
  width: 100%;
  height: 58px;
  margin: 0;
  padding: 21px 3.1rem 8px 1rem;
  font-family: var(--pmb-ui);
  font-size: 0.95rem;
  line-height: 1.2;
  color: var(--pmb-text);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--pmb-line);
  border-radius: 15px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  transition:
    border-color 0.25s ease,
    background-color 0.25s ease,
    box-shadow 0.25s ease;
}

/* reserve room for the reveal button on the password field */
.pmb-field--password .pmb-field__input { padding-right: 3.2rem; }

.pmb-field__input::placeholder { color: transparent; }

.pmb-field__label {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.95rem;
  color: var(--pmb-muted);
  pointer-events: none;
  transform-origin: left center;
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), color 0.22s ease, opacity 0.22s ease;
}

/* float the label when the field is focused or already filled */
.pmb-field__input:focus + .pmb-field__label,
.pmb-field__input:not(:placeholder-shown) + .pmb-field__label {
  transform: translateY(-19px) scale(0.76);
  color: var(--pmb-a1);
}

.pmb-field__input:hover { border-color: var(--pmb-line-2); }

.pmb-field__input:focus {
  background: rgba(255, 255, 255, 0.07);
  border-color: transparent;
  box-shadow:
    0 0 0 1.5px var(--pmb-a2),
    0 0 0 5px rgba(129, 140, 248, 0.16),
    0 14px 30px -18px rgba(94, 234, 212, 0.7);
}

/* gradient underline that wipes in on focus */
.pmb-field::after {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -1px;
  height: 2px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--pmb-a1), var(--pmb-a3));
  transform: scaleX(0);
  transform-origin: left center;
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.35s ease;
}
.pmb-field:focus-within::after { transform: scaleX(1); opacity: 1; }

.pmb-field__icon {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--pmb-faint);
  background: transparent;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
}
.pmb-field__icon:hover { color: var(--pmb-text); background: rgba(255, 255, 255, 0.07); }
.pmb-field__icon svg { width: 19px; height: 19px; }

.pmb-field__error {
  display: block;
  margin: 0.5rem 0 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--pmb-danger);
}

/* ------------------------------------------------------------- meta row */
.pmb-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.2rem;
}

/* custom checkbox */
.pmb-check {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--pmb-muted);
  user-select: none;
  -webkit-user-select: none;
}
.pmb-check input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  margin: 0;
}
.pmb-check__box {
  position: relative;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  border: 1px solid var(--pmb-line-2);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.pmb-check__box::after {
  content: '';
  position: absolute;
  top: 3px; left: 6.5px;
  width: 5px; height: 10px;
  border: solid #06121a;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0.4);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.pmb-check input:checked + .pmb-check__box {
  background: linear-gradient(135deg, var(--pmb-a1), var(--pmb-a2));
  border-color: transparent;
}
.pmb-check input:checked + .pmb-check__box::after { transform: rotate(45deg) scale(1); opacity: 1; }
.pmb-check:hover .pmb-check__box { border-color: var(--pmb-a1); }
.pmb-check input:focus-visible + .pmb-check__box {
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.35);
}

.pmb-link {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--pmb-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.pmb-link:hover { color: var(--pmb-a1); border-bottom-color: rgba(94, 234, 212, 0.4); }
.pmb-link:focus-visible { outline: 2px solid var(--pmb-a2); outline-offset: 3px; border-radius: 4px; }

/* ----------------------------------------------------------------- button */
.pmb-submit {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  min-height: 54px;
  margin-top: 0.5rem;
  padding: 0.9rem 1.5rem;
  font-family: var(--pmb-ui);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #04121a;
  background: linear-gradient(120deg, var(--pmb-a1) 0%, #7dd3fc 45%, var(--pmb-a2) 100%);
  background-size: 180% 100%;
  border: 0;
  border-radius: 15px;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 16px 34px -16px rgba(94, 234, 212, 0.6);
  transition: transform 0.2s ease, box-shadow 0.25s ease, background-position 0.5s ease, opacity 0.2s ease;
}
.pmb-submit:hover {
  background-position: 100% 0;
  transform: translateY(-1px);
  box-shadow: 0 20px 40px -16px rgba(94, 234, 212, 0.75);
}
.pmb-submit:active { transform: translateY(0) scale(0.994); }
.pmb-submit:focus-visible { outline: 2px solid #ffffff; outline-offset: 3px; }

/* sheen sweep */
.pmb-submit::after {
  content: '';
  position: absolute;
  top: 0;
  left: -60%;
  width: 45%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-18deg);
  transition: left 0.65s ease;
}
.pmb-submit:hover::after { left: 120%; }

.pmb-submit__label { display: inline-flex; align-items: center; gap: 0.55rem; }
.pmb-submit svg { width: 17px; height: 17px; }

.pmb-spinner {
  width: 17px;
  height: 17px;
  border: 2px solid rgba(4, 18, 26, 0.28);
  border-top-color: #04121a;
  border-radius: 50%;
  animation: pmbSpin 0.7s linear infinite;
  display: none;
}
.pmb-submit.is-busy { opacity: 0.85; pointer-events: none; }
.pmb-submit.is-busy .pmb-spinner { display: inline-block; }
.pmb-submit.is-busy .pmb-submit__label { display: none; }

/* ----------------------------------------------------------------- footer */
.pmb-form__foot {
  margin: 1.75rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--pmb-line);
  font-size: 0.72rem;
  line-height: 1.6;
  text-align: center;
  color: var(--pmb-faint);
}

/* ------------------------------------------------------- entrance motion */
/* Deliberately NOT starting from `opacity: 0` in the base rule. The `from`
   keyframe supplies the initial state and the `both` fill mode applies it
   during the stagger delay, so if animations are ever suppressed the elements
   simply stay visible instead of the whole form disappearing. */
.pmb-anim {
  animation: pmbRise 0.72s cubic-bezier(0.16, 0.84, 0.34, 1) both;
}
.pmb-anim--1 { animation-delay: 0.05s; }
.pmb-anim--2 { animation-delay: 0.13s; }
.pmb-anim--3 { animation-delay: 0.21s; }
.pmb-anim--4 { animation-delay: 0.29s; }
.pmb-anim--5 { animation-delay: 0.37s; }
.pmb-anim--6 { animation-delay: 0.45s; }

@keyframes pmbRise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes pmbDrift {
  0%   { opacity: 0;    transform: scale(1.06); }
  6%   { opacity: 0.5;  }
  30%  { opacity: 0.42; transform: scale(1.11); }
  36%  { opacity: 0;    transform: scale(1.11); }
  100% { opacity: 0;    transform: scale(1.06); }
}
@keyframes pmbFloat {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%      { transform: translate3d(3vmax, -2vmax, 0) scale(1.08); }
}
@keyframes pmbSpin {
  to { transform: rotate(360deg); }
}

/* ------------------------------------------------------------- responsive */
@media (max-width: 940px) {
  .pmb-shell {
    grid-template-columns: 1fr;
    max-width: 480px;
  }
  .pmb-brand {
    border-right: 0;
    border-bottom: 1px solid var(--pmb-line);
    padding-bottom: 1.75rem;
  }
  .pmb-brand__list,
  .pmb-brand__foot { display: none; }
  .pmb-brand__tagline { display: none; }
  .pmb-brand__name { font-size: clamp(1.3rem, 5vw, 1.6rem); }
  .pmb-brand__rule { margin-top: 1rem; }
}

@media (max-width: 480px) {
  .pmb-auth { padding: 0; align-items: stretch; }
  .pmb-shell {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    min-height: 100vh;
    min-height: 100dvh;
  }
  .pmb-field__input { height: 56px; }
}

/* short viewports: trim the brand so the form stays reachable */
@media (max-height: 720px) and (min-width: 941px) {
  .pmb-brand__list { display: none; }
  .pmb-brand__tagline { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .pmb-auth *,
  .pmb-auth *::before,
  .pmb-auth *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .pmb-anim { opacity: 1; transform: none; }
  .pmb-backdrop img { opacity: 0.4; }
  .pmb-backdrop img:nth-child(1) { opacity: 0.4; }
  .pmb-backdrop img:nth-child(n+2) { display: none; }
}
