:root {
  --bio-navy: #073b61;
  --bio-navy-dark: #031e3b;
  --bio-blue: #167bb8;
  --bio-blue-dark: #07548e;
  --bio-blue-soft: #e8f4fc;
  --bio-gold: #f1c83f;
  --bio-white: #ffffff;
  --bio-bg: #f4f8fc;
  --bio-text: #133b5b;
  --bio-muted: #6f8294;
  --bio-border: #d8e6f0;
  --bio-danger: #c84a59;
  --bio-page-top: #ffffff;
  --bio-card-bg: rgba(255, 255, 255, .97);
  --bio-input-bg: #f8fbfe;
  --bio-input-border: #d2e1ee;
}

html, body { min-height: 100%; }
body { margin: 0; background: var(--bio-bg); color: var(--bio-text); }
.bio-login-page, .bio-login-page * { box-sizing: border-box; }

.bio-login-page {
  display: grid;
  grid-template-columns: minmax(420px, 47%) minmax(0, 53%);
  min-height: 100vh;
  background: var(--bio-bg);
}

/* Left institutional panel */
.bio-login-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 38px;
  min-height: 100vh;
  padding: 48px 58px;
  overflow: hidden;
  color: var(--bio-white);
  text-align: center;
  background:
    radial-gradient(circle at 15% 18%, rgba(79, 186, 230, .30), transparent 29%),
    radial-gradient(circle at 86% 82%, rgba(241, 200, 63, .13), transparent 29%),
    linear-gradient(145deg, var(--bio-navy-dark), var(--bio-navy) 59%, #0b6797);
}

.bio-login-visual::before,
.bio-login-visual::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.bio-login-visual::before {
  inset: 0;
  opacity: .12;
  background-image:
    linear-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .08) 1px, transparent 1px);
  background-size: 45px 45px;
}

.bio-login-visual::after {
  top: -180px;
  right: -210px;
  width: 430px;
  height: 430px;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 50%;
  box-shadow: 0 0 0 50px rgba(255, 255, 255, .022), 0 0 0 100px rgba(255, 255, 255, .014);
}

.bio-welcome-copy, .bio-security-note { position: relative; z-index: 1; }
.bio-welcome-copy { max-width: 525px; }

.bio-department-logo {
  display: block;
  width: min(100%, 230px);
  height: auto;
  margin: 0 auto 27px;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 0 1px rgba(255, 255, 255, .8)) drop-shadow(0 0 2px rgba(39, 136, 160, .22));
}

.bio-university-name {
  max-width: 430px;
  margin: 0 auto;
  color: var(--bio-white);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
}

.bio-welcome-copy > p {
  max-width: 490px;
  margin: 21px auto 0;
  color: rgba(255, 255, 255, .72);
  font-size: 13px;
  line-height: 1.75;
}

.bio-feature-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  margin-top: 36px;
}

.bio-feature-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 35px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  color: rgba(255, 255, 255, .88);
  background: rgba(255, 255, 255, .06);
  font-size: 10px;
  font-weight: 650;
}

.bio-tag-dot, .bio-security-dot {
  display: inline-block;
  border-radius: 50%;
  background: var(--bio-gold);
  box-shadow: 0 0 11px rgba(241, 200, 63, .72);
}
.bio-tag-dot { width: 6px; height: 6px; }
.bio-security-dot { width: 7px; height: 7px; }

.bio-security-note {
  display: flex;
  align-items: center;
  gap: 9px;
  color: rgba(255, 255, 255, .58);
  font-size: 10px;
}

/* Right sign-in panel */
.bio-login-form-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 45px 7vw;
  overflow: hidden;
  background:
    radial-gradient(circle at 93% 8%, rgba(22, 123, 184, .10), transparent 24%),
    linear-gradient(180deg, var(--bio-page-top), var(--bio-bg));
}

.bio-login-form-panel::before,
.bio-login-form-panel::after {
  position: absolute;
  border: 1px solid rgba(22, 123, 184, .13);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}
.bio-login-form-panel::before { top: 70px; right: -105px; width: 210px; height: 210px; }
.bio-login-form-panel::after { bottom: 60px; left: -63px; width: 125px; height: 125px; }

.bio-login-container { position: relative; z-index: 1; width: 100%; max-width: 445px; text-align: center; }
.bio-form-heading { margin-bottom: 27px; }
.bio-form-kicker {
  margin: 0 0 8px;
  color: var(--bio-blue);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.bio-form-heading h2 {
  margin: 0;
  color: var(--bio-navy);
  font-size: 31px;
  font-weight: 750;
  line-height: 1.18;
  letter-spacing: -.03em;
}
.bio-form-heading p { margin: 10px 0 0; color: var(--bio-muted); font-size: 12px; line-height: 1.65; }

.bio-login-card {
  padding: 34px;
  border: 1px solid var(--bio-border);
  border-radius: 18px;
  background: var(--bio-card-bg);
  box-shadow: 0 20px 55px rgba(7, 59, 97, .10);
}
.bio-error-message { margin-bottom: 17px; padding: 11px 13px; border: 1px solid #efcbd0; border-radius: 9px; color: var(--bio-danger); background: #fff4f5; font-size: 10px; line-height: 1.55; }
.bio-success-message { margin-bottom: 17px; padding: 11px 13px; border: 1px solid #bfe8c9; border-radius: 9px; color: #1d7a3c; background: #eefaf0; font-size: 10px; line-height: 1.55; }
.bio-field-group { margin-bottom: 16px; }
.bio-field-label { display: block; margin-bottom: 7px; color: var(--bio-text); font-size: 10px; font-weight: 750; letter-spacing: .02em; }

.bio-field-control input:not([type="checkbox"]):not([type="radio"]),
.bio-field-control select,
.bio-field-control textarea {
  width: 100%;
  min-height: 49px;
  padding: 0 14px;
  border: 1px solid var(--bio-input-border);
  border-radius: 10px;
  outline: none;
  color: var(--bio-text);
  background: var(--bio-input-bg);
  font-size: 12px;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.bio-field-control textarea { min-height: 90px; padding-top: 12px; resize: vertical; }
.bio-field-control input::placeholder, .bio-field-control textarea::placeholder { color: var(--bio-muted); }
.bio-field-control input:focus, .bio-field-control select:focus, .bio-field-control textarea:focus {
  border-color: var(--bio-blue);
  background: var(--bio-card-bg);
  box-shadow: 0 0 0 3px rgba(22, 123, 184, .14);
}
.bio-field-errors ul.errorlist { margin: 7px 0 0; padding: 0; color: var(--bio-danger); font-size: 10px; line-height: 1.5; list-style: none; }

/* Password and account-form additions */
.bio-help-text {
  display: block;
  margin-top: 7px;
  color: var(--bio-muted);
  font-size: 9px;
  line-height: 1.5;
  text-align: left;
}

.bio-help-text ul {
  margin: 6px 0 0;
  padding-left: 17px;
}

.bio-dashboard-link {
  margin: 18px 0 0;
  color: var(--bio-muted);
  font-size: 10px;
  text-align: center;
}

.bio-dashboard-link a {
  color: var(--bio-blue-dark);
  font-weight: 700;
  text-decoration: none;
}

.bio-dashboard-link a:hover,
.bio-dashboard-link a:focus {
  text-decoration: underline;
}

/* Successful account-action confirmation */
.bio-complete-card {
  padding: 36px 34px;
  border: 1px solid var(--bio-border);
  border-radius: 18px;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 20px 55px rgba(7, 59, 97, .10);
  text-align: center;
}

.bio-success-icon {
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  margin: 0 auto 22px;
  border: 1px solid var(--bio-input-border);
  border-radius: 18px;
  color: var(--bio-blue-dark);
  background: var(--bio-blue-soft);
  box-shadow: 0 10px 24px rgba(22, 123, 184, .10);
}

.bio-success-icon svg {
  width: 33px;
  height: 33px;
}

.bio-complete-card h3 {
  margin: 0;
  color: var(--bio-navy);
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -.02em;
}

.bio-complete-message {
  margin: 17px 0 0;
  padding: 16px 17px;
  border: 1px solid var(--bio-border);
  border-radius: 11px;
  color: var(--bio-muted);
  background: var(--bio-input-bg);
  font-size: 11px;
  line-height: 1.7;
}

.bio-dashboard-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 49px;
  margin-top: 22px;
  border: 0;
  border-radius: 10px;
  color: var(--bio-white);
  background: linear-gradient(135deg, var(--bio-blue), var(--bio-blue-dark));
  box-shadow: 0 11px 24px rgba(22, 123, 184, .22);
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease;
}

.bio-dashboard-button:hover,
.bio-dashboard-button:focus {
  color: var(--bio-white);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(22, 123, 184, .28);
}

/* Registration-page additions */
.bio-signup-container {
  max-width: 480px;
}

.bio-signup-card {
  padding: 30px 32px;
}

.bio-option-list {
  display: grid;
  gap: 11px;
  margin: 18px 0 20px;
}

.bio-option {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--bio-muted);
  font-size: 10px;
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
}

.bio-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  flex: 0 0 auto;
  accent-color: var(--bio-blue);
  cursor: pointer;
}

.bio-option a {
  color: var(--bio-blue-dark);
  font-weight: 700;
  text-decoration: none;
}

.bio-option a:hover,
.bio-option a:focus {
  text-decoration: underline;
}

.bio-login-options { display: flex; align-items: center; justify-content: center; gap: 15px; margin: 18px 0 20px; }
.bio-save-details { display: inline-flex; align-items: center; gap: 8px; color: var(--bio-muted); font-size: 10px; cursor: pointer; }
.bio-save-details input { width: 16px; height: 16px; margin: 0; accent-color: var(--bio-blue); cursor: pointer; }
.bio-password-link, .bio-register-link a { color: var(--bio-blue-dark); font-weight: 700; text-decoration: none; }
.bio-password-link, .bio-register-link { font-size: 10px; }
.bio-password-link:hover, .bio-register-link a:hover { text-decoration: underline; }

.bio-login-button {
  width: 100%;
  min-height: 49px;
  border: 0;
  border-radius: 10px;
  color: var(--bio-white);
  background: linear-gradient(135deg, var(--bio-blue), var(--bio-blue-dark));
  box-shadow: 0 11px 24px rgba(22, 123, 184, .22);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}
.bio-login-button:hover, .bio-login-button:focus { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(22, 123, 184, .28); }
.bio-register-link { margin: 18px 0 0; color: var(--bio-muted); text-align: center; }
.bio-access-note { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 16px 0 0; color: var(--bio-muted); font-size: 9px; line-height: 1.55; }
.bio-access-note svg { width: 14px; height: 14px; flex: 0 0 auto; color: var(--bio-blue); }

/* ------------------------------------------------------------------ */
/* Dark mode                                                           */
/* Note: --bio-white / --bio-navy / --bio-navy-dark are deliberately   */
/* NOT redefined here — they're the fixed navy institutional panel on  */
/* the left (.bio-login-visual) and its always-white text, which stays */
/* the same regardless of site theme. Everything on the right (form)   */
/* side uses the tokens below instead.                                 */
/* ------------------------------------------------------------------ */
body.dark, .dark, [data-theme="dark"] {
  --bio-bg: #0d1720;
  --bio-text: #e7edf3;
  --bio-muted: #93a2b3;
  --bio-border: #2b3a49;
  --bio-blue-dark: #7fbdf7;
  --bio-blue-soft: rgba(76, 154, 239, 0.16);
  --bio-page-top: #101c27;
  --bio-card-bg: rgba(24, 33, 43, .97);
  --bio-input-bg: #111820;
  --bio-input-border: #2b3a49;
}

body.dark .bio-form-heading h2, .dark .bio-form-heading h2, [data-theme="dark"] .bio-form-heading h2,
body.dark .bio-complete-card h3, .dark .bio-complete-card h3, [data-theme="dark"] .bio-complete-card h3 {
  color: #f4f7fa !important;
}

body.dark .bio-error-message, .dark .bio-error-message, [data-theme="dark"] .bio-error-message {
  border-color: rgba(200, 74, 89, .4) !important;
  background: rgba(200, 74, 89, .14) !important;
  color: #ff8a93 !important;
}

body.dark .bio-success-message, .dark .bio-success-message, [data-theme="dark"] .bio-success-message {
  border-color: rgba(29, 122, 60, .4) !important;
  background: rgba(29, 122, 60, .16) !important;
  color: #3ecf8e !important;
}

body.dark .bio-field-errors ul.errorlist, .dark .bio-field-errors ul.errorlist, [data-theme="dark"] .bio-field-errors ul.errorlist {
  color: #ff8a93 !important;
}

@media (max-width: 980px) {
  .bio-login-page { grid-template-columns: minmax(340px, 42%) minmax(0, 58%); }
  .bio-login-visual { padding: 42px 36px; }
}

@media (max-width: 790px) {
  .bio-login-page { display: block; }
  .bio-login-visual { min-height: auto; padding: 48px 24px 40px; gap: 28px; }
  .bio-department-logo { width: min(100%, 190px); margin-bottom: 21px; }
  .bio-university-name { font-size: 16px; }
  .bio-welcome-copy > p { margin-top: 18px; font-size: 12px; line-height: 1.65; }
  .bio-feature-tags { margin-top: 26px; }
  .bio-feature-tag { min-height: 32px; padding: 0 11px; font-size: 9px; }
  .bio-login-form-panel { min-height: auto; padding: 34px 22px; }
}

@media (max-width: 480px) {
  .bio-login-form-panel { align-items: flex-start; padding: 27px 15px; }
  .bio-login-card { padding: 27px 21px; }
  .bio-signup-card { padding: 26px 21px; }
  .bio-complete-card { padding: 30px 21px; }
  .bio-form-heading h2 { font-size: 27px; }
  .bio-login-options { flex-direction: column; gap: 10px; }
}