/* SRTTS - Sign in / Register modal (sliding card). Self-contained. */
.auth-modal {
  --v: var(--brand-solid, #4C3EDB);
  --v6: var(--brand-600, #3F32C2);
  --v1: var(--brand-100, #E8E5FF);
  --ink: var(--text, #333333);
  --mut: var(--text-muted, #6B7280);
  --line: var(--border, #E4E1F2);
  --slide: cubic-bezier(.65, 0, .35, 1);
  font-family: 'Nunito', 'Inter', sans-serif;
  color: var(--ink)
}

body.auth-lock {
  overflow: hidden
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  background: rgba(30, 15, 80, .55);
  backdrop-filter: blur(4px)
}

.auth-modal.open {
  display: flex;
  animation: authFade .25s ease-out
}

@keyframes authFade {
  from {
    opacity: 0
  }

  to {
    opacity: 1
  }
}

.auth-modal-inner {
  position: relative;
  width: min(880px, 100%)
}

.auth-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 6;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  font: inherit;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: background .2s
}

.auth-stage[data-mode="login"] .auth-close {
  background: rgba(255, 255, 255, .2);
  color: #fff
}

.auth-stage[data-mode="login"] .auth-close:hover {
  background: rgba(255, 255, 255, .35)
}

.auth-stage[data-mode="register"] .auth-close {
  background: var(--v1);
  color: var(--v6)
}

.auth-stage[data-mode="register"] .auth-close:hover {
  background: #E2D8FB
}

.auth-stage {
  position: relative;
  width: 100%;
  height: min(600px, 100vh - 100px);
  min-height: 520px;
  background: #fff;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 30px 70px rgba(20, 8, 70, .35)
}

.auth-forms {
  position: absolute;
  top: 0;
  left: 0;
  width: 60%;
  height: 100%;
  transition: transform .7s var(--slide)
}

.auth-stage[data-mode="register"] .auth-forms {
  transform: translateX(66.6667%)
}

.auth-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 40%;
  height: 100%;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(160deg, #5B4CF0, #3A2DB0);
  transform: translateX(150%);
  transition: transform .7s var(--slide)
}

.auth-stage[data-mode="register"] .auth-overlay {
  transform: none
}

.auth-overlay::before {
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 170px;
  height: 170px;
  border-radius: 28px;
  background: rgba(255, 255, 255, .09);
  transform: rotate(45deg)
}

.auth-overlay::after {
  content: "";
  position: absolute;
  left: -90px;
  bottom: -90px;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  background: rgba(245, 183, 61, .38)
}

.ov-brand {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2
}

.ov-logo-card {
  position: absolute;
  top: 56px;
  left: 24px;
  right: 24px;
  background: #fff;
  border-radius: 16px;
  padding: 10px 14px;
  box-shadow: 0 8px 20px rgba(30, 15, 80, .2)
}

.brand-img {
  display: block;
  height: auto;
  max-width: 100%
}

.ov-logo-card .brand-img {
  width: 100%;
  max-width: 210px;
  margin: 0 auto
}

.brand-img.pane-logo {
  display: none;
  width: 170px;
  margin-bottom: 12px
}

.ov {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 36px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s, visibility 0s .3s
}

.ov h2 {
  font-size: 30px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 12px
}

.ov p {
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 26px;
  opacity: .92
}

.auth-stage[data-mode="login"] .ov-to-register,
.auth-stage[data-mode="register"] .ov-to-login {
  opacity: 1;
  visibility: visible;
  transition: opacity .4s .3s, visibility 0s
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  height: 42px;
  padding: 0 34px;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  transition: background .2s, color .2s
}

.btn-ghost:hover {
  background: #fff;
  color: var(--v6)
}

.auth-pane {
  position: absolute;
  inset: 0;
  padding: 26px 46px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s, visibility 0s .3s
}

.auth-pane::before,
.auth-pane::after {
  content: "";
  flex: 1 0 0
}

.auth-stage[data-mode="login"] .pane-login,
.auth-stage[data-mode="register"] .pane-register {
  opacity: 1;
  visibility: visible;
  transition: opacity .4s .3s, visibility 0s
}

.auth-modal h1 {
  font-size: 28px;
  font-weight: 800;
  margin: 0 0 6px;
  color: var(--v)
}

.auth-sub {
  font-size: 13px;
  color: var(--mut);
  margin: 0 0 14px
}

.auth-modal .form-group {
  margin: 0 0 10px
}

.auth-modal .form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-subtle, #4B5563);
  margin: 0 0 6px
}

.auth-modal .form-control {
  width: 100%;
  height: 40px;
  padding: 0 14px;
  border: 1.5px solid var(--input-border, #D3CEEC);
  border-radius: var(--radius-input, 10px);
  background: var(--input-bg, #fff);
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  box-sizing: border-box;
  transition: border-color .18s ease, box-shadow .18s ease
}

.auth-modal .form-control:hover {
  border-color: var(--v)
}

.auth-modal .form-control:focus {
  outline: 0;
  background: var(--input-bg, #fff);
  border-color: var(--v);
  box-shadow: 0 0 0 4px var(--brand-ring, rgba(76, 62, 219, .22))
}

.auth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px
}

.auth-grid .span2 {
  grid-column: 1/-1
}

.auth-modal .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 700
}

.auth-modal .btn-primary {
  background: var(--v);
  color: #fff;
  box-shadow: 0 8px 18px rgba(76,62,219, .25)
}

.auth-modal .btn-primary:hover {
  background: var(--v6)
}

.btn-pill {
  border-radius: 999px;
  height: 42px;
  font-size: 13px;
  letter-spacing: .04em;
  padding: 0 22px
}

.btn-block {
  width: 100%;
  margin-top: 6px
}

.auth-grid .btn {
  align-self: end;
  margin-bottom: 10px;
  width: 100%
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline
}

.link-btn {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--v);
  cursor: pointer
}

.link-btn:hover {
  text-decoration: underline
}

.auth-alt {
  text-align: center;
  font-size: 13px;
  color: var(--mut);
  margin: 14px 0 0
}

.auth-alt a {
  color: var(--v);
  font-weight: 700;
  text-decoration: none
}

.switch-mobile {
  display: none
}

.auth-modal .alert {
  padding: 10px 14px;
  font-size: 13px;
  margin: 0 0 12px;
  border-radius: 12px;
  background: #FEF2F2;
  color: #991B1B;
  border: 1px solid #FECACA
}

.auth-modal .alert-success {
  background: #F0FDF4;
  color: #166534;
  border-color: #BBF7D0
}

.auth-modal .alert-warning {
  background: #FFFBEB;
  color: #92400E;
  border-color: #FDE68A
}

.auth-modal .alert-info {
  background: #EFF6FF;
  color: #1E40AF;
  border-color: #BFDBFE
}

.auth-modal .alert a {
  display: inline-block;
  margin-top: 4px;
  color: inherit;
  font-weight: 700;
  text-decoration: underline
}

.demo {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  font-size: 12px;
  color: var(--mut)
}

.demo summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none
}

.demo summary::-webkit-details-marker {
  display: none
}

.demo dl {
  margin: 10px 0 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px
}

.demo dt {
  font-weight: 600;
  color: var(--ink)
}

.demo dd {
  margin: 0
}

.demo code {
  background: var(--v1);
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 11px
}

@media(max-width:760px) {
  .auth-modal {
    align-items: flex-start;
    overflow-y: auto
  }

  .auth-stage {
    height: auto;
    min-height: 0
  }

  .auth-overlay {
    display: none
  }

  .auth-stage .auth-close {
    background: var(--v1) !important;
    color: var(--v6) !important
  }

  .auth-forms {
    position: static;
    width: 100%;
    transform: none !important
  }

  .auth-pane {
    position: static;
    display: none;
    padding: 28px 22px;
    opacity: 1;
    visibility: visible
  }

  .auth-pane::before,
  .auth-pane::after {
    display: none
  }

  .auth-stage[data-mode="login"] .pane-login,
  .auth-stage[data-mode="register"] .pane-register {
    display: flex
  }

  .switch-mobile {
    display: block
  }

  .auth-grid {
    grid-template-columns: 1fr
  }

  .brand-img.pane-logo {
    display: block
  }
}

@media(prefers-reduced-motion:reduce) {

  .auth-forms,
  .auth-overlay,
  .auth-pane,
  .ov,
  .auth-modal.open {
    transition: none !important;
    animation: none !important
  }
}
/* Year level chips */
.year-chips {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.year-chips input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.year-chips label {
  flex: 1 1 0;
  min-width: 64px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1.5px solid var(--input-border, #D3CEEC);
  border-radius: 999px;
  background: #F7F4FF;
  color: var(--mut);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: background .2s, color .2s, border-color .2s, box-shadow .2s, transform .15s;
}
.year-chips label:hover {
  border-color: var(--v);
  color: var(--v6);
  background: var(--v1);
}
.year-chips input:checked + label {
  background: var(--v);
  border-color: var(--v);
  color: #fff;
  box-shadow: 0 6px 14px rgba(76,62,219, .28);
  transform: translateY(-1px);
}
.year-chips input:focus-visible + label {
  outline: 3px solid rgba(76,62,219, .35);
  outline-offset: 2px;
}
@media (max-width: 520px) {
  .year-chips label { flex: 1 1 28%; }
}



/* Privacy Notice consent checkbox (login and register) */
.auth-modal .privacy-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 400;
  cursor: pointer
}

.auth-modal .privacy-consent input[type="checkbox"] {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  cursor: pointer
}

.auth-modal .privacy-consent a {
  text-decoration: underline
}

/* Live password checklist (assets/js/pw-rules.js) */
.pw-rules-title { margin: 0 0 6px; font-size: 13px; font-weight: 700; }
ul.pw-rules { list-style: none; margin: 0 0 14px; padding: 0; font-size: 13px; text-align: left; }
ul.pw-rules li { position: relative; padding-left: 22px; margin: 3px 0; color: #6B7280; }
ul.pw-rules li::before { content: "\2022"; position: absolute; left: 6px; top: 0; }
ul.pw-rules.started li:not(.ok) { color: #991B1B; }
ul.pw-rules.started li:not(.ok)::before { content: "\2715"; left: 3px; }
ul.pw-rules li.ok { color: #166534; font-weight: 600; }
ul.pw-rules li.ok::before { content: "\2713"; left: 3px; }
