:root {
  --primary: #8054D9;
  --dark: #56339B;
  --lavender: #EDE5FF;
  --lavender-light: #F7F3FF;
  --white: #FFFFFF;
  --text: #3F286F;
  --muted: #7A6AA0;
  --line: #E2D6FF;
  color-scheme: light;
  font-family: Poppins, Inter, "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: var(--lavender-light);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: #EDE5FF; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: transparent; /* keep transparent so .campus-bg (z-index:-1, painted above html bg) stays visible */
}
button, input { font: inherit; }
/* Fixed campus photo layer: stuck to viewport, behind content but above html bg.
   Uses the generated photo: assets/images/campus-bg.png (PNG first, SVG fallback in markup). */
.campus-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background-color: #EDE5FF;
  background-image:
    linear-gradient(rgba(255,255,255,.42), rgba(237,229,255,.48)),
    url('../images/campus-bg.png');
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
  background-attachment: fixed, fixed;
}
.campus-bg img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.campus-bg::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(rgba(255,255,255,.42), rgba(237,229,255,.48));
}


.login-shell {
  position: relative;
  isolation: isolate;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  overflow: clip;
  background: transparent;
}

.login-shell::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  background: transparent;
}

/* Slim light-lavender header like reference */
.site-header {
  width: 100%;
  margin: 0;
  padding: 10px clamp(16px, 4vw, 42px);
  background: rgba(247,243,255,.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.header-login {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}
.header-login svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--dark);
  font-family: Poppins, Inter, "Segoe UI", Arial, sans-serif;
  font-size: clamp(14px, 2.4vw, 17px);
  font-weight: 800;
  letter-spacing: -.01em;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}

.brand-logo {
  display: grid;
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  place-items: center;
  overflow: hidden;
  border: 0;
  border-radius: 15px;
  background: #7544C8;
  color: #fff;
  box-shadow: 0 6px 16px rgba(117,68,200,.35);
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand-logo-hero {
  display: block;
  width: 100px;
  height: 100px;
  margin-bottom: 16px;
  border-radius: 24px;
  box-shadow: 0 10px 26px rgba(117,68,200,.30);
}

.login-layout {
  display: grid;
  width: min(1280px, calc(100% - 64px));
  flex: 1;
  grid-template-columns: minmax(0, 1.05fr) 460px;
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 3vw, 48px);
  margin: 0 auto;
  padding: 18px 0 22px;
  min-height: 0;
}

.welcome-panel {
  min-width: 0;
}

.welcome-copy {
  max-width: 640px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.welcome-subtitle {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-shadow: 0 1px 6px rgba(255,255,255,.9), 0 0 2px rgba(255,255,255,.9);
}

.welcome-copy h1 {
  max-width: 100%;
  margin: 0;
  color: var(--dark);
  font-size: clamp(34px, 4.6vw, 58px);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.05;
  text-wrap: balance;
  text-shadow: 0 2px 10px rgba(255,255,255,.95), 0 0 3px rgba(255,255,255,.9);
}

.welcome-description {
  max-width: 480px;
  margin: 14px 0 22px;
  color: #3F286F;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.7;
  text-shadow: 0 1px 6px rgba(255,255,255,.95), 0 0 2px rgba(255,255,255,.9);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.feature-card {
  display: flex;
  min-height: 64px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 16px;
  background: rgba(255,255,255,.68);
  box-shadow: 0 4px 14px rgba(86,51,155,.08);
  backdrop-filter: blur(6px);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}

.feature-icon,
.user-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  color: var(--primary);
}

.feature-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--lavender);
}

.feature-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.login-panel {
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
  min-height: 0;
}

.login-card {
  width: 400px;
  max-width: 92vw;
  box-sizing: border-box;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 18px 50px rgba(86,51,155,.14);
}

.card-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.user-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--lavender);
  color: var(--dark);
}

.user-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.card-heading h2 {
  margin: 0;
  color: var(--dark);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.01em;
}

.card-heading p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.err {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #F2C7D2;
  border-radius: 12px;
  background: #FFF3F5;
  color: #8D3450;
  font-size: 13px;
  line-height: 1.5;
}

.login-card .field {
  display: block;
  margin: 0 0 12px;
}

.login-card .field > label {
  display: block;
  margin: 0 0 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

.input-wrap {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  fill: none;
  stroke: #9B8CC7;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  pointer-events: none;
}

.login-card .input-wrap input {
  width: 100%;
  box-sizing: border-box;
  min-height: 46px;
  padding: 0 14px 0 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.login-card .input-wrap input::placeholder {
  color: #A79BC4;
}

.login-card .input-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(128,84,217,.18);
}

.login-card .captcha-input {
  width: 100%;
  box-sizing: border-box;
  min-height: 46px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.login-card .captcha-input::placeholder {
  color: #A79BC4;
}

.login-card .captcha-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(128,84,217,.18);
}

.login-card .input-wrap input[name="password"] {
  padding-right: 66px;
}

.toggle-password {
  position: absolute;
  top: 50%;
  right: 8px;
  padding: 8px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.toggle-password:hover {
  background: var(--lavender-light);
}

.captcha-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 2px 0 8px;
}

.captcha-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.captcha-hint {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.captcha-row {
  display: flex;
  min-height: 0;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.captcha-code {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-sizing: border-box;
  width: 100%;
  min-height: 46px;
  margin: 0 0 10px;
  padding: 4px 12px;
  border: 1px dashed rgba(128,84,217,.45);
  border-radius: 12px;
  background: var(--lavender-light);
}

#captchaImg {
  display: block;
  width: 150px;
  height: 38px;
  border: 0;
  border-radius: 0;
  background: transparent;
  object-fit: contain;
}

#captchaText {
  color: var(--text);
  font-family: Poppins, Inter, sans-serif;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 7px;
  text-align: center;
  white-space: nowrap;
}

.captcha-refresh {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--lavender-light);
  color: var(--primary);
  cursor: pointer;
  transition: background .18s ease, transform .18s ease;
}

.captcha-refresh:hover {
  transform: rotate(-25deg);
  background: var(--lavender);
}

.captcha-refresh svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.btn {
  width: 100%;
  box-sizing: border-box;
  min-height: 48px;
  margin-top: 10px;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(110deg, #9B6BF0, var(--primary) 55%, #6A3FC7);
  box-shadow: 0 10px 22px rgba(128,84,217,.35);
  color: #fff;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  transition: box-shadow .18s ease, transform .18s ease, filter .18s ease;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
  box-shadow: 0 14px 26px rgba(128,84,217,.4);
}

.btn:focus-visible,
.captcha-refresh:focus-visible,
.toggle-password:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}

.login-footnote {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}

.login-footnote svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--primary);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.demo-accounts {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.demo-accounts h3 {
  margin: 0 0 6px;
  color: var(--dark);
  font-size: 15px;
}

.demo-accounts p {
  margin: 4px 0 0;
}

.demo-accounts code {
  color: var(--dark);
}

.photo-credit {
  position: absolute;
  right: 12px;
  bottom: 8px;
  color: rgba(76, 42, 133, .68);
  font-size: 10px;
  text-align: right;
}

@media (max-width: 1000px) {
  .login-layout {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
    gap: 24px;
  }
}

@media (max-width: 880px) {
  .site-header {
    padding: 10px 16px;
  }
  .brand-link {
    font-size: 15px;
  }
  .brand-logo {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
    border-radius: 13px;
  }
  .brand-logo-hero {
    width: 84px;
    height: 84px;
    margin-bottom: 14px;
  }
  .login-layout {
    width: min(100% - 32px, 620px);
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 20px 0 40px;
  }
  .welcome-copy {
    max-width: 100%;
    padding: 0;
  }
  .login-card {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 16px 18px;
  }
  .card-heading {
    margin-bottom: 10px;
  }
  .login-card .field {
    margin-bottom: 8px;
  }
  .login-card .field > label {
    margin-bottom: 4px;
  }
  .login-card .input-wrap input,
  .login-card .captcha-input {
    min-height: 40px;
  }
  .captcha-heading {
    margin-top: 0;
    margin-bottom: 5px;
  }
  .captcha-code {
    min-height: 40px;
    margin-bottom: 6px;
    padding-top: 2px;
    padding-bottom: 2px;
  }
  .btn {
    min-height: 42px;
    margin-top: 6px;
  }
  .login-footnote {
    margin-top: 8px;
  }
  .demo-accounts {
    margin-top: 10px;
    padding-top: 8px;
    font-size: 12px;
    line-height: 1.35;
  }
  .demo-accounts h3 {
    margin-bottom: 3px;
    font-size: 14px;
  }
  .demo-accounts p {
    margin-top: 3px;
  }
  .photo-credit {
    position: static;
    padding: 0 12px 8px;
  }
}

@media (max-width: 520px) {
  .login-layout {
    padding: 18px 0 34px;
  }
  .welcome-copy {
    padding: 0;
  }
  .welcome-copy h1 {
    font-size: 34px;
  }
  .feature-grid {
    gap: 9px;
  }
  .feature-card {
    min-height: 58px;
    font-size: 11.5px;
  }
  .login-card {
    width: calc(100% - 12px);
    max-width: 92vw;
    padding: 14px 14px;
    border-radius: 20px;
  }
  .card-heading h2 {
    font-size: 23px;
  }
  #captchaText {
    letter-spacing: 4px;
    font-size: 17px;
  }
  .captcha-heading span {
    display: none;
  }
}

@media (max-height: 500px) and (min-width: 700px) and (max-width: 880px) {
  .login-layout {
    width: calc(100% - 32px);
    grid-template-columns: minmax(0, 1fr) minmax(300px, 400px);
    gap: 18px;
    padding: 2px 0;
  }
  .brand-logo-hero,
  .feature-grid {
    display: none;
  }
  .welcome-copy h1 {
    font-size: clamp(24px, 3.5vw, 32px);
  }
  .welcome-description {
    margin: 8px 0;
    font-size: 13px;
  }
  .login-card {
    width: 100%;
    max-width: 400px;
    padding: 10px 14px;
  }
  .card-heading {
    margin-bottom: 6px;
  }
  .user-icon {
    width: 34px;
    height: 34px;
  }
  .card-heading h2 {
    font-size: 20px;
  }
  .card-heading p {
    font-size: 11px;
  }
  .login-card form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto auto 30px 34px;
    column-gap: 10px;
    row-gap: 2px;
  }
  .login-card form > .field:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
  }
  .login-card form > .field:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
  }
  .captcha-heading {
    grid-column: 1;
    grid-row: 2;
    margin: 0;
  }
  .captcha-heading span {
    display: none;
  }
  .captcha-row {
    grid-column: 1;
    grid-row: 3;
    min-height: 0;
    margin: 0;
  }
  .captcha-refresh {
    width: 26px;
    height: 26px;
    flex-basis: 26px;
  }
  .captcha-code {
    grid-column: 1;
    grid-row: 4;
    min-height: 30px;
    margin: 0;
    padding: 0 6px;
  }
  #captchaImg {
    height: 25px;
  }
  .login-card form > .field:nth-child(6) {
    grid-column: 2;
    grid-row: 2 / 4;
    align-self: end;
    margin: 0;
  }
  .login-card .field > label {
    margin-bottom: 2px;
    font-size: 11px;
  }
  .login-card .input-wrap input,
  .login-card .captcha-input {
    min-height: 32px;
    font-size: 12px;
  }
  .btn {
    grid-column: 2;
    grid-row: 4;
    align-self: end;
    min-height: 32px;
    margin: 0;
    font-size: 13px;
  }
  .login-footnote {
    margin-top: 4px;
    font-size: 9px;
  }
  .demo-accounts {
    margin-top: 6px;
    padding-top: 5px;
    font-size: 10px;
    line-height: 1.2;
  }
  .demo-accounts h3 {
    margin: 0 0 2px;
    font-size: 12px;
  }
  .demo-accounts p {
    margin: 2px 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
