.hn-slider {
  position: relative;
  height: 42px;
  border-radius: 12px;
  background: #f4f1f8;
  border: 1px solid #e4deee;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.hn-slider-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: #e7f8ef; }
.hn-slider span { position: absolute; inset: 0; display: grid; place-items: center; color: #6b6576; font-size: 13px; }
.hn-slider button, .hn-slider-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 36px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: #1a1a2e;
  color: #fff;
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.hn-slider.ok { border-color: #86efac; }
.login-page .hidden { display: none !important; }
.verify-modal { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 24px; }
.verify-modal.hidden { display: none; }
.verify-backdrop { position: absolute; inset: 0; border: 0; background: rgba(20, 18, 34, .58); backdrop-filter: blur(5px); }
.verify-dialog { position: relative; width: min(100%, 380px); padding: 30px 28px 28px; border: 1px solid rgba(255,255,255,.7); border-radius: 22px; background: #fff; box-shadow: 0 28px 90px rgba(15, 12, 30, .28); text-align: center; animation: verify-in .18s ease-out; }
.verify-close { position: absolute; top: 12px; right: 14px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: #f4f2f8; color: #625d70; font-size: 23px; line-height: 1; cursor: pointer; }
.verify-mark { display: grid; place-items: center; width: 44px; height: 44px; margin: 0 auto 12px; border-radius: 15px; background: #eee9fb; color: #7046cf; font-size: 22px; font-weight: 700; }
.verify-dialog h2 { margin: 0; color: #242035; font-size: 20px; }
.verify-dialog p { margin: 8px 0 20px; color: #817b8e; font-size: 13px; }
.verify-dialog .hn-slider { text-align: left; }
@keyframes verify-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
body.login-page {
  background: #1a1a2e;
  overflow: hidden;
  height: 100vh;
  min-height: 100vh;
  letter-spacing: 0;
}

#login-page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 100vh;
}

.left-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(145deg, #eee9f6 0%, #e5e0ef 48%, #d8d4e8 100%);
  padding: 40px 48px;
  overflow: hidden;
}

.left-panel .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 600;
  color: #1a1a2e;
  z-index: 10;
  position: relative;
}

.left-panel .logo .brand-logo {
  display: block;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 10px;
}

.campus-team {
  position: relative;
  z-index: 10;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
  max-width: 720px;
  width: 100%;
  margin: 24px auto 0;
}

.campus-team-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.campus-team-kicker { color: #746795; font-size: 10px; font-weight: 800; letter-spacing: .18em; }
.campus-team-heading h2 { margin: 8px 0 0; color: #242035; font-size: clamp(25px, 3vw, 34px); letter-spacing: -.04em; }
.campus-team-count { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 38px; padding: 0 12px; border: 1px solid rgba(66,49,104,.12); border-radius: 13px; background: rgba(255,255,255,.58); color: #60469d; font-size: 13px; font-weight: 700; }
.campus-team-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; max-height: min(54vh, 490px); overflow: auto; padding: 2px 3px 8px 0; scrollbar-width: thin; }
.campus-team-card { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 13px; border: 1px solid rgba(72,59,102,.1); border-radius: 16px; background: rgba(255,255,255,.72); box-shadow: 0 10px 26px rgba(49,38,76,.045); backdrop-filter: blur(10px); }
.campus-team-avatar { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; overflow: hidden; border: 1px solid rgba(89,67,141,.12); border-radius: 14px; background: linear-gradient(145deg, #ede7fb, #d8cff1); color: #5e4792; font-size: 16px; font-weight: 700; }
.campus-team-avatar img { width: 100%; height: 100%; padding: 2px; object-fit: contain; background: #fff; }
.campus-team-meta { min-width: 0; }
.campus-team-name { overflow: hidden; color: #29263a; font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.campus-team-type { margin-top: 5px; color: #898396; font-size: 11px; }
.campus-team-empty { grid-column: 1 / -1; padding: 26px; border: 1px dashed rgba(72,59,102,.2); border-radius: 16px; color: #777183; font-size: 13px; text-align: center; }
.campus-team-loading { display: flex; gap: 12px; grid-column: 1 / -1; }
.campus-team-loading span { height: 72px; flex: 1; border-radius: 16px; background: linear-gradient(90deg, rgba(255,255,255,.46), rgba(255,255,255,.8), rgba(255,255,255,.46)); background-size: 200% 100%; animation: team-shimmer 1.5s ease-in-out infinite; }
@keyframes team-shimmer { to { background-position: -200% 0; } }

.left-panel::after {
  content: '';
  position: absolute;
  top: 20%;
  right: 15%;
  width: 260px;
  height: 260px;
  background: rgba(180,170,200,0.25);
  border-radius: 50%;
  filter: blur(80px);
}

.left-panel::before {
  content: '';
  position: absolute;
  bottom: 15%;
  left: 10%;
  width: 350px;
  height: 350px;
  background: rgba(200,195,210,0.2);
  border-radius: 50%;
  filter: blur(100px);
}

.right-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  padding: 40px;
}

.form-container {
  width: 100%;
  max-width: 400px;
}

.sparkle-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.sparkle-icon .brand-logo {
  display: block;
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 14px;
}

.form-header {
  text-align: center;
  margin-bottom: 36px;
}

.form-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: #1a1a2e;
  letter-spacing: -0.5px;
  margin: 0 0 6px;
}

.form-header p {
  font-size: 14px;
  color: #888;
  margin: 0;
}

.login-page .form-group {
  margin-bottom: 20px;
}

.login-page .form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #333;
  margin-bottom: 8px;
}

.login-page .form-group .input-wrapper {
  position: relative;
}

.login-page .form-group input {
  width: 100%;
  height: 48px;
  border: none;
  border-bottom: 1.5px solid #e0e0e0;
  border-radius: 0;
  padding: 0 40px 0 0;
  font-size: 15px;
  font-family: inherit;
  color: #1a1a2e;
  background: transparent;
  outline: none;
  box-shadow: none;
  transition: border-color 0.3s;
}

.login-page .form-group input:focus {
  border-bottom-color: #5B21B6;
  box-shadow: none;
}

.login-page .form-group input::placeholder {
  color: #ccc;
}

.login-page .form-group input[type="password"]:not(:placeholder-shown) {
  font-family: inherit;
  letter-spacing: 2px;
}

.toggle-password {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #666;
  padding: 6px;
  transition: color 0.2s;
}

.toggle-password:hover { color: #333; }
.toggle-password:focus-visible { outline: 2px solid #6c3ff5; outline-offset: 4px; border-radius: 6px; }

.btn-login,
.btn-alt {
  position: relative;
  width: 100%;
  height: 50px;
  border-radius: 25px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  overflow: hidden;
  margin-bottom: 14px;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
}

.btn-login {
  border: 1.5px solid #1a1a2e;
  background: #1a1a2e;
  color: #fff;
}

.btn-alt {
  border: 1.5px solid #e0e0e0;
  background: #f5f5f5;
  color: #333;
}

.btn-login .btn-text,
.btn-alt .btn-text {
  display: inline-block;
  transition: all 0.3s;
}

.btn-login .btn-hover-content,
.btn-alt .btn-hover-content {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #5B21B6;
  color: #fff;
  opacity: 0;
  transition: all 0.3s;
  border-radius: 25px;
}

.btn-login:hover .btn-text,
.btn-alt:hover .btn-text {
  transform: translateX(40px);
  opacity: 0;
}

.btn-login:hover .btn-hover-content,
.btn-alt:hover .btn-hover-content {
  opacity: 1;
}

.btn-login:disabled {
  opacity: .7;
  cursor: not-allowed;
}

.signup-link {
  text-align: center;
  font-size: 13px;
  color: #888;
  margin-top: 32px;
}

.signup-link a {
  color: #1a1a2e;
  font-weight: 600;
  text-decoration: none;
}

.signup-link a:hover { text-decoration: underline; }

@media (max-width: 980px) { .campus-team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  body.login-page { height: auto; min-height: 100vh; overflow: auto; }
  #login-page { min-height: 100vh; height: auto; grid-template-columns: 1fr; }
  .left-panel { min-height: 310px; padding: 24px 22px 28px; }
  .left-panel .logo { font-size: 17px; }
  .campus-team { margin-top: 28px; }
  .campus-team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 220px; }
  .campus-team-card { padding: 9px; gap: 9px; }
  .campus-team-avatar { width: 38px; height: 38px; flex-basis: 38px; border-radius: 12px; }
  .right-panel { min-height: 560px; padding: 34px 24px; }
}
@media (max-width: 380px) { .campus-team-grid { grid-template-columns: 1fr; } }
.login-page .err.error-msg,
.login-page .error-msg {
  display: none;
  padding: 10px 14px;
  font-size: 13px;
  color: #dc2626;
  background: rgba(220,38,38,0.08);
  border: 1px solid rgba(220,38,38,0.2);
  border-radius: 10px;
  margin-bottom: 16px;
}

.login-page .form-group input.error {
  border-bottom-color: #dc2626;
}

@media (max-width: 1000px) {
  .left-panel { padding: 28px 24px; }
  .right-panel { padding: 32px; }
}
@media (max-width: 760px) {
  body.login-page { overflow: auto; height: auto; }
  #login-page { grid-template-columns: 1fr; height: auto; min-height: 100dvh; }
  .left-panel { padding: 20px 24px 16px; gap: 10px; }
  .right-panel { padding: 30px 24px; }
  .sparkle-icon { display: none; }
  .form-header { margin-bottom: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .login-page *, .login-page *::before, .login-page *::after { transition: none !important; animation: none !important; }
}
@media (hover: none) {
  .btn-login:hover .btn-text,
  .btn-alt:hover .btn-text { transform: none; opacity: 1; }
  .btn-login:hover .btn-hover-content,
  .btn-alt:hover .btn-hover-content { opacity: 0; }
}

/* Keep the mobile login and team directory inside the first screen. */
.campus-team-grid { overscroll-behavior: contain; }
.campus-team-card {
  animation: team-card-in .34s both cubic-bezier(.2,.75,.25,1);
  animation-delay: calc(min(var(--team-index, 0), 12) * 32ms);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.campus-team-card:hover { transform: translateY(-3px); border-color: rgba(91,33,182,.2); box-shadow: 0 14px 30px rgba(49,38,76,.1); }
.campus-team-avatar img { display: block; padding: 0; object-fit: contain; }
@keyframes team-card-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 760px) {
  body.login-page { width: 100%; height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
  #login-page { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(190px, 36dvh) minmax(0, 1fr); width: 100%; height: 100%; min-height: 0; }
  .left-panel { min-height: 0; padding: max(14px, env(safe-area-inset-top)) 20px 12px; gap: 8px; }
  .left-panel .logo { gap: 8px; font-size: 15px; }
  .left-panel .logo .brand-logo { width: 30px; height: 30px; border-radius: 9px; }
  .campus-team { width: 100%; max-width: 620px; min-height: 0; margin: 4px auto 0; }
  .campus-team-heading { align-items: center; }
  .campus-team-heading h2 { margin-top: 3px; font-size: 22px; }
  .campus-team-kicker { display: none; }
  .campus-team-count { min-width: auto; height: 30px; padding: 0 10px; border-radius: 10px; font-size: 11px; }
  .campus-team-grid { flex: 1 1 auto; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; max-height: none; min-height: 0; margin-top: 9px; overflow: auto; padding: 1px 3px 5px 0; }
  .campus-team-card { min-height: 54px; padding: 7px; gap: 8px; border-radius: 12px; }
  .campus-team-avatar { width: 36px; height: 36px; flex-basis: 36px; border-radius: 10px; }
  .campus-team-name { font-size: 12px; }
  .campus-team-type { margin-top: 2px; font-size: 10px; }
  .campus-team-empty { padding: 12px; }
  .right-panel { min-height: 0; align-items: flex-start; overflow: auto; overscroll-behavior: contain; padding: 12px 24px max(16px, env(safe-area-inset-bottom)); }
  .form-container { width: 100%; max-width: 400px; margin: auto; }
  .sparkle-icon { display: flex; margin-bottom: 8px; }
  .sparkle-icon .brand-logo { width: 40px; height: 40px; border-radius: 12px; }
  .form-header { margin-bottom: 18px; }
  .form-header h1 { font-size: 24px; }
  .login-page .form-group { margin-bottom: 12px; }
  .login-page .form-group label { margin-bottom: 4px; }
  .login-page .form-group input { height: 42px; }
  .btn-login, .btn-alt { height: 44px; margin-bottom: 9px; }
  .signup-link { margin-top: 12px; }
}

@media (max-width: 380px) {
  .campus-team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .left-panel { padding-right: 14px; padding-left: 14px; }
  .right-panel { padding-right: 20px; padding-left: 20px; }
}
@media (max-height: 700px) and (max-width: 760px) {
  #login-page { grid-template-rows: minmax(160px, 32dvh) minmax(0, 1fr); }
  .campus-team-heading h2 { font-size: 19px; }
  .campus-team-grid { gap: 5px; margin-top: 6px; }
  .campus-team-card { min-height: 45px; padding: 5px 7px; }
  .campus-team-avatar { width: 32px; height: 32px; flex-basis: 32px; }
  .sparkle-icon { margin-bottom: 5px; }
  .sparkle-icon .brand-logo { width: 34px; height: 34px; }
  .form-header { margin-bottom: 12px; }
  .login-page .form-group { margin-bottom: 8px; }
  .login-page .form-group input { height: 37px; }
  .btn-login, .btn-alt { height: 40px; margin-bottom: 7px; }
}

.email-code-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: stretch; }
.email-code-row .input-wrapper { min-width: 0; }
.email-code-button { width: auto; min-width: 118px; height: 48px; margin: 0; padding: 0 14px; white-space: nowrap; }
.email-code-button:disabled { cursor: wait; opacity: .68; }
.error-msg.success-msg { color: #16804a; }
@media (max-width: 380px) {
  .email-code-row { gap: 7px; }
  .email-code-button { min-width: 104px; padding: 0 9px; font-size: 12px; }
}
