/* ══════════════════════════════════════════════════════════════════
   auth-login.css  |  Research Portal Login Page
   ══════════════════════════════════════════════════════════════════ */

html, body { height: 100%; overflow: hidden; }
@media (max-width: 767px) { html, body { overflow: auto; } }

/* ── Split layout ── */
.auth-page { display: flex; height: 100dvh; overflow: hidden; }

/* ════════════════════════════════════
   LEFT BRAND PANEL
════════════════════════════════════ */
.auth-brand {
  flex: 1;
  background: linear-gradient(155deg, #001230 0%, #002575 55%, #001840 100%);
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  padding: 36px 40px; flex-shrink: 0;
}
@media (max-width: 767px) { .auth-brand { display: none; } }

.auth-brand-inner { position: relative; z-index: 1; width: 100%; max-width: 460px; }

.auth-logo-link { display: inline-block; margin-bottom: 24px; }
.auth-logo { height: 46px; width: auto; opacity: .92; }

.auth-brand-title {
  font-family: 'Merriweather', serif;
  font-size: clamp(1.2rem, 2.2vw, 1.9rem);
  font-weight: 800; color: #fff; line-height: 1.2; margin-bottom: 12px;
  white-space: nowrap;
}
.auth-brand-sub {
  font-size: .88rem; color: rgba(255,255,255,.58);
  line-height: 1.75; max-width: 360px; margin-bottom: 20px;
}

/* Stat pills */
.auth-brand-stats { display: flex; flex-direction: row; flex-wrap: wrap; gap: .5rem; margin-bottom: 28px; }
.auth-stat {
  display: inline-flex; align-items: center; gap: .6rem;
  padding: .45rem 1rem;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50px;
  font-size: .82rem; color: rgba(255,255,255,.75);
  width: fit-content;
}
.auth-stat i { color: #FF6C00; font-size: .85rem; }

/* Security tips (change-password panel) */
.auth-tips { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 40px; }
.auth-tip {
  display: flex; align-items: center; gap: .65rem;
  font-size: .84rem; color: rgba(255,255,255,.65);
}
.auth-tip i { color: #4ade80; font-size: .82rem; flex-shrink: 0; }

/* Back link */
.auth-brand-link {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .8rem; font-weight: 600; color: rgba(255,255,255,.5);
  text-decoration: none; transition: color .18s;
}
.auth-brand-link:hover { color: #fff; }

/* Decorative blobs */
.auth-blob { position: absolute; border-radius: 50%; pointer-events: none; }
.auth-blob-1 {
  width: 380px; height: 380px; top: -120px; right: -120px;
  background: radial-gradient(circle, rgba(97,185,240,.1) 0%, transparent 70%);
}
.auth-blob-2 {
  width: 260px; height: 260px; bottom: -60px; left: -60px;
  background: radial-gradient(circle, rgba(255,108,0,.08) 0%, transparent 70%);
}

/* ════════════════════════════════════
   RIGHT FORM PANEL
════════════════════════════════════ */
.auth-panel {
  width: 42%;
  flex-shrink: 0;
  background: linear-gradient(145deg, #f0f4ff 0%, #e8f0fe 50%, #f5f0ff 100%);
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
  padding: 40px 72px;
}
@media (max-width: 1100px) { .auth-panel { width: 580px; padding: 40px 48px; } }
@media (max-width: 991px)  { .auth-panel { width: 480px; padding: 40px 36px; } }
@media (max-width: 767px)  { .auth-panel { width: 100%; padding: 40px 24px; } }

.auth-form-wrap { width: 100%; max-width: 420px; position: relative; z-index: 1; }

/* Decorative floating boxes */
.auth-deco { position: absolute; pointer-events: none; z-index: 0; }
.auth-deco-1 {
  width: 240px; height: 240px; top: -80px; right: -60px;
  background: linear-gradient(135deg, rgba(0,55,123,.14) 0%, rgba(0,85,179,.08) 100%);
  border: 2px solid rgba(0,55,123,.18); border-radius: 28px;
  transform: rotate(22deg); backdrop-filter: blur(2px);
}
.auth-deco-2 {
  width: 160px; height: 160px; bottom: -55px; left: -40px;
  background: linear-gradient(135deg, rgba(255,108,0,.12) 0%, rgba(255,146,64,.06) 100%);
  border: 2px solid rgba(255,108,0,.18); border-radius: 22px; transform: rotate(-20deg);
}
.auth-deco-3 {
  width: 90px; height: 90px; top: 28px; left: 24px;
  background: linear-gradient(135deg, rgba(97,185,240,.18) 0%, rgba(97,185,240,.06) 100%);
  border: 2px solid rgba(97,185,240,.28); border-radius: 16px; transform: rotate(14deg);
}
.auth-deco-4 {
  width: 56px; height: 56px; bottom: 44px; right: 32px;
  background: linear-gradient(135deg, rgba(0,55,123,.12) 0%, rgba(0,55,123,.05) 100%);
  border: 2px solid rgba(0,55,123,.15); border-radius: 12px; transform: rotate(38deg);
}
.auth-deco-5 {
  width: 110px; height: 110px; top: 45%; right: -30px;
  background: linear-gradient(135deg, rgba(0,55,123,.08) 0%, rgba(97,185,240,.06) 100%);
  border: 2px solid rgba(97,185,240,.2); border-radius: 20px; transform: rotate(-10deg);
}
.auth-deco-6 {
  width: 44px; height: 44px; top: 40%; left: 20px;
  background: linear-gradient(135deg, rgba(255,108,0,.14) 0%, rgba(255,146,64,.06) 100%);
  border: 2px solid rgba(255,108,0,.20); border-radius: 10px; transform: rotate(25deg);
}

/* Mobile logo */
.auth-mob-logo { display: none; text-align: center; margin-bottom: 28px; }
.auth-mob-logo img { height: 44px; }
@media (max-width: 767px) { .auth-mob-logo { display: block; } }

/* Theme-aware mobile logo */
.auth-mob-logo-dark { display: none; }
[data-adm-theme="dark"] .auth-mob-logo-light { display: none; }
[data-adm-theme="dark"] .auth-mob-logo-dark  { display: inline-block; }

/* ════════════════════════════════════
   FORM
════════════════════════════════════ */
.auth-form-head { margin-bottom: 32px; }
.auth-form-title {
  font-family: 'Merriweather', serif;
  font-size: 1.55rem; font-weight: 800;
  color: #1a2740; margin-bottom: 6px; line-height: 1.2;
}
.auth-form-sub { font-size: .85rem; color: #6b7fa3; margin: 0; }

/* Fields */
.auth-field { margin-bottom: 20px; }
.auth-label {
  display: block; font-size: .8rem; font-weight: 700;
  color: #4a5a7a; margin-bottom: 7px;
  text-transform: uppercase; letter-spacing: .04em;
}
.auth-input-wrap { position: relative; display: flex; align-items: center; }
.auth-input-icon {
  position: absolute; left: 14px;
  color: #9aaac8; font-size: .95rem; pointer-events: none; z-index: 1;
}
.auth-input {
  width: 100%; padding: 11px 42px 11px 40px;
  background: #fff; border: 2px solid #dde4f0;
  border-radius: 10px; font-size: .9rem; color: #1a2740;
  transition: border-color .18s, box-shadow .18s;
  outline: none; font-family: inherit;
}
.auth-input::placeholder { color: #b0bcd4; }
.auth-input:focus { border-color: #00377B; box-shadow: 0 0 0 3px rgba(0,55,123,.1); }

.auth-pwd-toggle {
  position: absolute; right: 12px;
  background: none; border: none; cursor: pointer;
  color: #9aaac8; font-size: .95rem; padding: 4px;
  transition: color .15s; display: flex; align-items: center;
}
.auth-pwd-toggle:hover { color: #00377B; }

/* Remember me toggle */
.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.auth-toggle-label {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: .84rem; color: #4a5a7a; cursor: pointer; user-select: none;
}
.auth-toggle-input { position: absolute; opacity: 0; width: 0; height: 0; }
.auth-toggle-track {
  position: relative; width: 42px; height: 24px;
  background: #cbd5e1; border-radius: 50px;
  transition: background .25s; flex-shrink: 0;
}
.auth-toggle-thumb {
  position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; background: #fff;
  border-radius: 50%; box-shadow: 0 1px 4px rgba(0,0,0,.2);
  transition: transform .25s;
}
.auth-toggle-input:checked + .auth-toggle-track { background: #00377B; }
.auth-toggle-input:checked + .auth-toggle-track .auth-toggle-thumb { transform: translateX(18px); }

/* Forgot password link */
.auth-forgot-link {
  font-size: .82rem; font-weight: 700;
  color: #FF6C00; text-decoration: none; transition: opacity .18s;
}
.auth-forgot-link:hover { opacity: .75; }

/* Submit button — matches news portal */
.auth-submit-btn {
  width: 100%; padding: 13px;
  background: linear-gradient(135deg, #00377B 0%, #0055B3 100%);
  color: #fff; border: none; border-radius: 10px;
  font-size: .95rem; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: opacity .2s, transform .15s, box-shadow .2s;
  box-shadow: 0 4px 18px rgba(0,55,123,.3);
  margin-top: 4px; margin-bottom: 20px; font-family: inherit;
}
.auth-submit-btn:hover { opacity: .92; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,55,123,.38); }
.auth-submit-btn:active { transform: scale(.98); }

/* Django-rendered form inputs (change password page) */
.auth-django-field { margin-bottom: 20px; }
.auth-django-field input[type="password"],
.auth-django-field input[type="text"] {
  width: 100%; padding: 11px 14px;
  background: #fff; border: 2px solid #dde4f0;
  border-radius: 10px; font-size: .9rem; color: #1a2740;
  transition: border-color .18s, box-shadow .18s;
  outline: none; font-family: inherit; display: block;
}
.auth-django-field input[type="password"]::placeholder,
.auth-django-field input[type="text"]::placeholder { color: #b0bcd4; }
.auth-django-field input[type="password"]:focus,
.auth-django-field input[type="text"]:focus {
  border-color: #00377B; box-shadow: 0 0 0 3px rgba(0,55,123,.1);
}
.auth-field-hint {
  font-size: .76rem; color: #8a9bbd; margin-top: 6px; line-height: 1.5;
}

/* OTP inputs (verify-account page) */
.auth-otp-group {
  display: flex; gap: .65rem; justify-content: center; margin: .5rem 0 1.75rem;
}
.auth-otp-input {
  width: 52px; height: 58px;
  text-align: center; font-size: 1.5rem; font-weight: 700;
  font-family: 'Merriweather', serif;
  color: #1a2740; background: #fff;
  border: 2px solid #dde4f0; border-radius: 12px;
  outline: none; transition: border-color .18s, box-shadow .18s;
  caret-color: #00377B;
}
.auth-otp-input:focus {
  border-color: #00377B; box-shadow: 0 0 0 3px rgba(0,55,123,.1);
}
.auth-otp-input.filled { border-color: #00377B; background: #f0f5ff; }
@media (max-width: 400px) {
  .auth-otp-input { width: 42px; height: 50px; font-size: 1.25rem; }
  .auth-otp-group { gap: .4rem; }
}

/* Help text */
.auth-help { text-align: center; font-size: .8rem; color: #8a9bbd; margin: 0; }
.auth-help a { color: #00377B; font-weight: 600; }
.auth-help a:hover { color: #FF6C00; }

/* Auth-input without right toggle (edit form) */
.auth-input-wrap:not(:has(.auth-pwd-toggle)) .auth-input { padding-right: 14px; }

/* Two-column grid for register form */
.auth-form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}
@media (max-width: 400px) {
  .auth-form-grid-2 { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════
   DARK MODE — [data-adm-theme="dark"]
   ══════════════════════════════════════════ */

/* Right form panel */
[data-adm-theme="dark"] .auth-panel {
  background: linear-gradient(145deg, #0d1117 0%, #111827 55%, #0f0d1a 100%);
}

/* Deco shapes — slightly more visible in dark */
[data-adm-theme="dark"] .auth-deco-1 {
  background: linear-gradient(135deg, rgba(96,165,250,.1) 0%, rgba(59,130,246,.06) 100%);
  border-color: rgba(96,165,250,.14);
}
[data-adm-theme="dark"] .auth-deco-2 {
  background: linear-gradient(135deg, rgba(255,108,0,.1) 0%, rgba(255,146,64,.05) 100%);
  border-color: rgba(255,108,0,.16);
}
[data-adm-theme="dark"] .auth-deco-3 {
  background: linear-gradient(135deg, rgba(97,185,240,.12) 0%, rgba(97,185,240,.05) 100%);
  border-color: rgba(97,185,240,.2);
}
[data-adm-theme="dark"] .auth-deco-4,
[data-adm-theme="dark"] .auth-deco-5 {
  background: linear-gradient(135deg, rgba(96,165,250,.08) 0%, rgba(59,130,246,.04) 100%);
  border-color: rgba(96,165,250,.12);
}
[data-adm-theme="dark"] .auth-deco-6 {
  background: linear-gradient(135deg, rgba(255,108,0,.1) 0%, rgba(255,146,64,.05) 100%);
  border-color: rgba(255,108,0,.16);
}

/* Form heading */
[data-adm-theme="dark"] .auth-form-title { color: #e2e8f0; }
[data-adm-theme="dark"] .auth-form-sub   { color: #64748b; }

/* Labels */
[data-adm-theme="dark"] .auth-label { color: #94a3b8; }

/* Text inputs */
[data-adm-theme="dark"] .auth-input {
  background: #1a1f2e;
  border-color: rgba(255,255,255,.1);
  color: #e2e8f0;
}
[data-adm-theme="dark"] .auth-input::placeholder { color: #4a6080; }
[data-adm-theme="dark"] .auth-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}

/* Password toggle icon */
[data-adm-theme="dark"] .auth-input-icon    { color: #4a6080; }
[data-adm-theme="dark"] .auth-pwd-toggle    { color: #4a6080; }
[data-adm-theme="dark"] .auth-pwd-toggle:hover { color: #93c5fd; }

/* Remember-me toggle */
[data-adm-theme="dark"] .auth-toggle-label  { color: #94a3b8; }
[data-adm-theme="dark"] .auth-toggle-track  { background: #2d3748; }

/* Django-rendered password fields (change-password page) */
[data-adm-theme="dark"] .auth-django-field input[type="password"],
[data-adm-theme="dark"] .auth-django-field input[type="text"] {
  background: #1a1f2e;
  border-color: rgba(255,255,255,.1);
  color: #e2e8f0;
}
[data-adm-theme="dark"] .auth-django-field input[type="password"]::placeholder,
[data-adm-theme="dark"] .auth-django-field input[type="text"]::placeholder { color: #4a6080; }
[data-adm-theme="dark"] .auth-django-field input[type="password"]:focus,
[data-adm-theme="dark"] .auth-django-field input[type="text"]:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
[data-adm-theme="dark"] .auth-field-hint { color: #64748b; }

/* OTP boxes (verify-account page) */
[data-adm-theme="dark"] .auth-otp-input {
  background: #1a1f2e;
  border-color: rgba(255,255,255,.1);
  color: #e2e8f0;
  caret-color: #3b82f6;
}
[data-adm-theme="dark"] .auth-otp-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
[data-adm-theme="dark"] .auth-otp-input.filled {
  border-color: #3b82f6;
  background: rgba(59,130,246,.1);
}

/* Help text */
[data-adm-theme="dark"] .auth-help   { color: #64748b; }
[data-adm-theme="dark"] .auth-help a { color: #60a5fa; }
[data-adm-theme="dark"] .auth-help a:hover { color: #FF6C00; }

/* Forgot link */
[data-adm-theme="dark"] .auth-forgot-link { color: #fb923c; }

/* ── Scholar register link (login page) ── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 1.25rem 0 1rem;
  color: var(--text-muted, #94a3b8);
  font-size: .8rem;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color, #e2e8f0);
}
.auth-scholar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  width: 100%;
  padding: .7rem 1.25rem;
  border: 1.5px solid #0055B3;
  border-radius: 10px;
  color: #0055B3;
  font-size: .9rem;
  font-weight: 700;
  text-decoration: none;
  background: rgba(0,85,179,.06);
  transition: background .2s, transform .15s;
  margin-bottom: .5rem;
}
.auth-scholar-btn:hover {
  background: rgba(0,85,179,.13);
  color: #00377B;
  transform: translateY(-1px);
}

/* Dark mode */
[data-adm-theme="dark"] .auth-divider { color: #475569; }
[data-adm-theme="dark"] .auth-divider::before,
[data-adm-theme="dark"] .auth-divider::after { background: rgba(255,255,255,.1); }
[data-adm-theme="dark"] .auth-scholar-btn { border-color: #3b82f6; color: #60a5fa; background: rgba(59,130,246,.08); }
[data-adm-theme="dark"] .auth-scholar-btn:hover { background: rgba(59,130,246,.15); color: #93c5fd; }
