/* Django-only states. The reference stylesheet remains byte-identical to index.html's styles.css. */
.login-page button.forgot-link {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-family: inherit;
  line-height: normal;
  text-align: inherit;
}
.login-page .login-feedback {
  position: absolute;
  z-index: 20;
  top: calc(-74 * var(--ref-px));
  right: 0;
  width: min(100%, 540px);
  color: #7e1535;
  background: #fff6f8;
  border: 1px solid #efb2c2;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(27, 39, 78, .13);
  padding: 10px 14px;
  font-size: clamp(12px, 1.05vw, 16px);
}
.login-page .login-feedback-item { margin: 0; }
.login-page .login-feedback-item + .login-feedback-item { margin-top: 5px; }
.login-page .login-password-recovery {
  position: absolute;
  z-index: 21;
  top: calc(487 * var(--ref-px));
  left: calc(40 * var(--ref-px));
  width: calc(534 * var(--ref-px));
  max-width: calc(100% - 24px);
  margin: 0;
  padding: 12px 16px;
  background: #fff;
  color: #10244b;
  font-size: clamp(12px, 1.05vw, 16px);
  line-height: 1.4;
  border: 1px solid #b9cbe4;
  border-radius: 10px;
  box-shadow: 0 7px 20px rgba(25, 57, 100, .15);
}
.login-page .login-password-recovery[hidden] { display: none !important; }
.login-page .forgot-link:focus-visible { outline: 3px solid #5b90d8; outline-offset: 3px; }
@media (max-width: 900px) {
  .login-page .login-feedback {
    top: auto;
    bottom: calc(100% + 7px);
    left: 0;
    right: 0;
    width: 100%;
    font-size: 12px;
    padding: 7px 11px;
  }
  .login-page .login-password-recovery {
    top: auto;
    bottom: 8%;
    left: 5%;
    width: 90%;
    max-width: none;
    font-size: clamp(12px, 3vw, 15px);
  }
}



/*
 * Desktop reference geometry: the 1672 x 941 layout scales uniformly.
 * On wider displays distribute the additional space between the columns,
 * not entirely outside them. The photo and curved accent share a box.
 * The packaged reference stylesheet remains untouched.
 */
.campus-art { display: contents; }
.campus-ribbons { display: none; }

@media screen and (min-width: 901px) {
  .login-page {
    width: 100%;
    min-height: 100svh;
  }

  .login-page > .artboard {
    --ref-px: min(0.05980861vw, 0.10626993svh);
    --design-extra: max(0px, calc(100vw - (1672 * var(--ref-px))));
    --outer-shift: calc(var(--design-extra) * .12);
    position: relative;
    inset: auto;
    transform: none;
    width: 100%;
    height: 100svh;
    min-height: 100svh;
    margin: 0;
    isolation: isolate;
  }

  .login-page .art-scene { inset: 0; }
  .login-page .campus-art {
    display: block;
    position: absolute;
    left: 0;
    bottom: calc(-50 * var(--ref-px));
    width: calc((1030 * var(--ref-px)) + (var(--design-extra) * .60));
    height: calc(520 * var(--ref-px));
    isolation: isolate;
    pointer-events: none;
  }
  .login-page .campus-ribbons {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
  }
  .login-page .campus-image,
  .login-page .campus-colorwash {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    clip-path: url(#campusPhotoClip);
    -webkit-clip-path: url(#campusPhotoClip);
  }
  .login-page .campus-image { z-index: 1; }
  .login-page .campus-colorwash { z-index: 2; }
  /* The existing light panel is still above the complete campus group. */
  .login-page .scene-light { z-index: 2; }

  .login-page .brand-section {
    top: calc(50% - (432.5 * var(--ref-px)));
    left: calc((142 * var(--ref-px)) + var(--outer-shift));
    max-width: calc(780 * var(--ref-px));
  }
  .login-page .feature-grid {
    top: calc(50% - (64.5 * var(--ref-px)));
    left: calc((108 * var(--ref-px)) + var(--outer-shift));
  }
  .login-page .login-card {
    top: calc(50% - (352.5 * var(--ref-px)));
    left: auto;
    right: calc((101 * var(--ref-px)) + var(--outer-shift));
  }

  /* Keep a measured gap between the two lines, subtitle and feature tiles. */
  .login-page .desktop-intro h1 {
    font-size: calc(72 * var(--ref-px));
    line-height: 1;
    letter-spacing: calc(-1.8 * var(--ref-px));
  }
  .login-page .desktop-intro h1 span {
    margin-top: calc(6 * var(--ref-px));
  }
  .login-page .desktop-intro p {
    margin-top: calc(10 * var(--ref-px));
    font-size: calc(26 * var(--ref-px));
    line-height: 1.25;
    max-width: calc(780 * var(--ref-px));
  }

  /* Reference widths, precisely centred inside the 610px login card. */
  .login-page .login-form,
  .login-page .partner-section,
  .login-page .login-password-recovery {
    left: calc(38 * var(--ref-px));
    right: calc(38 * var(--ref-px));
    width: auto;
  }
  .login-page .form-rule {
    left: calc(56 * var(--ref-px));
    right: calc(56 * var(--ref-px));
    width: auto;
  }
}

/* On phones/tablets the original stacked mobile composition is authoritative.
   It can scroll vertically on short displays rather than clipping controls. */
@media screen and (max-width: 900px) {
  .login-page { overflow-x: clip; overflow-y: auto; }
  .login-page > .artboard { overflow: visible; }
  .login-page .login-card { max-width: 100%; }
}
