:root {
  --b9-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --b9-radius-lg: 28px;
  --b9-radius-md: 18px;
  --b9-radius-sm: 12px;
  --b9-transition: 180ms ease;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body.b9-web {
  font-family: var(--b9-font);
  overflow-x: hidden;
}

.b9-theme-light {
  --bg: #f4f3ff;
  --bg-2: #eef2ff;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-strong: #ffffff;
  --sidebar: linear-gradient(180deg, #5b63e8 0%, #5262dc 55%, #5666d9 100%);
  --sidebar-soft: rgba(255, 255, 255, 0.16);
  --text: #172033;
  --muted: #66708a;
  --line: rgba(91, 99, 232, 0.14);
  --input: #ffffff;
  --input-line: #d9def2;
  --accent: #5c5ef1;
  --accent-2: #7c5cff;
  --accent-soft: #ebeaff;
  --shadow: 0 28px 70px rgba(76, 87, 190, 0.16);
  --sidebar-text: #ffffff;
  --sidebar-muted: rgba(255, 255, 255, 0.78);
}

.b9-theme-dark {
  --bg: #07101f;
  --bg-2: #0b1530;
  --panel: rgba(17, 27, 49, 0.86);
  --panel-strong: #101a2f;
  --sidebar: linear-gradient(180deg, #111b31 0%, #0f1a30 100%);
  --sidebar-soft: rgba(98, 105, 244, 0.18);
  --text: #f3f6ff;
  --muted: #9aa6bf;
  --line: rgba(169, 181, 220, 0.14);
  --input: rgba(7, 16, 31, 0.72);
  --input-line: rgba(169, 181, 220, 0.18);
  --accent: #6269f4;
  --accent-2: #7c5cff;
  --accent-soft: rgba(98, 105, 244, 0.18);
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.42);
  --sidebar-text: #f3f6ff;
  --sidebar-muted: #b0b9d1;
}

.login-shell {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 176px 1fr;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 14%, rgba(124, 92, 255, 0.14), transparent 28%),
    radial-gradient(circle at 88% 70%, rgba(92, 94, 241, 0.16), transparent 34%),
    linear-gradient(135deg, var(--bg), var(--bg-2));
}

.login-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.06) 48%, transparent 49%),
    radial-gradient(circle at 92% 20%, rgba(124, 92, 255, 0.13), transparent 18%);
}

.login-sidebar {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  padding: 34px 18px 24px;
  display: flex;
  flex-direction: column;
  background: var(--sidebar);
  color: var(--sidebar-text);
  box-shadow: 18px 0 44px rgba(0, 0, 0, 0.08);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px 34px;
}

.brand-mark,
.mobile-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  font-weight: 900;
  font-size: 12px;
  letter-spacing: -0.04em;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.brand-name {
  font-size: 20px;
  font-weight: 850;
  letter-spacing: -0.03em;
}

.side-nav {
  display: grid;
  gap: 10px;
}

.side-nav-link {
  min-height: 48px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 14px;
  color: var(--sidebar-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 650;
  transition: background var(--b9-transition), color var(--b9-transition), transform var(--b9-transition);
}

.side-nav-link:hover,
.side-nav-link.is-active {
  color: var(--sidebar-text);
  background: var(--sidebar-soft);
}

.side-nav-link:hover {
  transform: translateX(2px);
}

.side-nav-icon {
  width: 24px;
  text-align: center;
  font-size: 17px;
}

.side-footer {
  margin-top: auto;
}

.login-main {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 64px 28px 34px;
  display: grid;
  grid-template-rows: 1fr auto;
  place-items: center;
}

.login-card {
  width: min(100%, 430px);
  padding: 34px 34px 28px;
  border: 1px solid var(--line);
  border-radius: var(--b9-radius-lg);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.login-badge {
  width: 62px;
  height: 62px;
  margin: 0 auto 20px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  color: #ffffff;
  font-size: 24px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 16px 38px rgba(92, 94, 241, 0.28);
}

.login-head {
  text-align: center;
  margin-bottom: 28px;
}

.login-head h1 {
  margin: 0;
  font-size: clamp(26px, 4vw, 36px);
  line-height: 1.05;
  letter-spacing: -0.055em;
}

.login-head p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.login-form {
  display: grid;
  gap: 18px;
}

.language-row,
.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.language-row > span,
.field > span {
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
}

.segmented {
  display: flex;
  gap: 8px;
}

.segmented a,
.lang-pill,
.theme-pill {
  min-width: 42px;
  min-height: 32px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: var(--muted);
  background: var(--accent-soft);
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
}

.segmented a.is-active,
.lang-pill:hover,
.theme-pill:hover {
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.field {
  display: grid;
  gap: 8px;
}

.field input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid var(--input-line);
  border-radius: 13px;
  outline: none;
  color: var(--text);
  background: var(--input);
  font: inherit;
  font-size: 15px;
  transition: border-color var(--b9-transition), box-shadow var(--b9-transition);
}

.field input:focus {
  border-color: rgba(92, 94, 241, 0.76);
  box-shadow: 0 0 0 4px rgba(92, 94, 241, 0.14);
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.check-row input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}

.soft-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
  font-weight: 750;
}

.soft-link:hover {
  text-decoration: underline;
}

.login-btn {
  min-height: 54px;
  border: 0;
  border-radius: 14px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font: inherit;
  font-size: 15px;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 16px 34px rgba(92, 94, 241, 0.24);
  transition: transform var(--b9-transition), box-shadow var(--b9-transition);
}

.login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 42px rgba(92, 94, 241, 0.30);
}

.secure-note {
  padding-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.secure-note span:first-child {
  color: var(--accent);
}

.login-footer {
  padding-top: 30px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.mobile-topbar,
.mobile-drawer {
  display: none;
}

@media (max-width: 860px) {
  .login-shell {
    display: block;
    min-height: 100vh;
  }

  .login-sidebar {
    display: none;
  }

  .mobile-topbar {
    position: relative;
    z-index: 3;
    min-height: 64px;
    padding: 0 16px;
    display: grid;
    grid-template-columns: 42px 1fr auto;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.42);
    backdrop-filter: blur(18px);
  }

  .b9-theme-dark .mobile-topbar {
    background: rgba(7, 16, 31, 0.62);
  }

  .mobile-menu-btn {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: var(--text);
    background: var(--panel);
    text-decoration: none;
    font-size: 20px;
    font-weight: 800;
  }

  .mobile-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    color: var(--text);
    font-weight: 850;
    letter-spacing: -0.03em;
  }

  .mobile-brand-mark {
    width: 27px;
    height: 27px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
  }

  .mobile-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }

  .theme-pill {
    min-width: 52px;
  }

  .login-main {
    min-height: calc(100vh - 64px);
    padding: 34px 16px 24px;
  }

  .login-card {
    width: min(100%, 390px);
    padding: 26px 20px 22px;
    border-radius: 24px;
  }

  .login-badge {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    margin-bottom: 18px;
  }

  .login-head {
    margin-bottom: 24px;
  }

  .login-head h1 {
    font-size: 27px;
  }

  .field input {
    min-height: 50px;
  }

  .form-row {
    align-items: flex-start;
  }

  .mobile-drawer {
    position: fixed;
    inset: 0;
    z-index: 20;
    padding: 18px;
    background: rgba(0, 0, 0, 0.38);
  }

  .mobile-drawer:target {
    display: block;
  }

  .mobile-drawer-card {
    width: min(100%, 320px);
    min-height: calc(100vh - 36px);
    padding: 18px;
    border-radius: 24px;
    background: var(--panel-strong);
    box-shadow: var(--shadow);
  }

  .drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 20px;
  }

  .drawer-close {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: var(--text);
    background: var(--accent-soft);
    text-decoration: none;
    font-size: 24px;
    line-height: 1;
  }

  .drawer-nav {
    display: grid;
    gap: 10px;
  }

  .drawer-link {
    min-height: 48px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 14px;
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 750;
  }

  .drawer-link.is-active,
  .drawer-link:hover {
    background: var(--accent-soft);
    color: var(--accent);
  }

  .drawer-help {
    margin-top: 28px;
  }
}

@media (max-width: 420px) {
  .mobile-topbar {
    padding: 0 10px;
    grid-template-columns: 38px 1fr auto;
  }

  .theme-pill {
    display: none;
  }

  .login-main {
    padding-left: 12px;
    padding-right: 12px;
  }

  .login-card {
    padding-left: 18px;
    padding-right: 18px;
  }

  .language-row,
  .form-row {
    gap: 12px;
  }

  .soft-link,
  .check-row {
    font-size: 12px;
  }
}

.login-shell-auth {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 88px 1fr;
  min-height: 100vh;
}

.login-shell-auth .login-topbar {
  position: relative;
  z-index: 4;
  min-height: 88px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px);
}

.b9-theme-dark .login-shell-auth .login-topbar {
  background: rgba(7, 16, 31, 0.72);
}

.login-shell-auth .mobile-brand {
  justify-content: flex-start;
  font-size: 26px;
}

.login-shell-auth .mobile-brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  font-size: 20px;
}

.login-shell-auth .mobile-actions {
  gap: 18px;
}

.login-shell-auth .theme-pill,
.login-shell-auth .lang-pill {
  min-height: 54px;
  padding: 0 26px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  color: var(--text);
  font-size: 16px;
}

.login-shell-auth .login-main {
  min-height: calc(100vh - 88px);
  padding-top: 56px;
}

.login-shell-auth .login-card {
  width: min(100%, 560px);
  padding: 54px 52px 44px;
}

.login-shell-auth .login-head h1 {
  font-size: 44px;
}

.login-shell-auth .login-head p {
  font-size: 18px;
}

.login-shell-auth .field input {
  min-height: 64px;
  font-size: 18px;
}

.login-shell-auth .login-btn {
  min-height: 64px;
  font-size: 18px;
}

@media (max-width: 860px) {
  .login-shell-auth {
    grid-template-rows: 72px 1fr;
  }

  .login-shell-auth .login-topbar {
    min-height: 72px;
    padding: 0 16px;
  }

  .login-shell-auth .mobile-brand {
    font-size: 18px;
  }

  .login-shell-auth .mobile-brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    font-size: 14px;
  }

  .login-shell-auth .theme-pill,
  .login-shell-auth .lang-pill {
    min-height: 42px;
    padding: 0 14px;
    font-size: 13px;
  }

  .login-shell-auth .login-main {
    min-height: calc(100vh - 72px);
    padding-top: 34px;
  }

  .login-shell-auth .login-card {
    width: min(100%, 420px);
    padding: 34px 24px 28px;
  }

  .login-shell-auth .login-head h1 {
    font-size: 32px;
  }

  .login-shell-auth .login-head p {
    font-size: 15px;
  }

  .login-shell-auth .field input {
    min-height: 54px;
    font-size: 15px;
  }

  .login-shell-auth .login-btn {
    min-height: 56px;
    font-size: 15px;
  }
}

@media (max-width: 420px) {
  .login-shell-auth .theme-pill {
    display: inline-flex;
  }

  .login-shell-auth .theme-pill {
    min-width: auto;
  }

  .login-shell-auth .login-topbar {
    padding: 0 12px;
  }

  .login-shell-auth .mobile-actions {
    gap: 8px;
  }

  .login-shell-auth .theme-pill {
    padding: 0 10px;
    font-size: 12px;
  }

  .login-shell-auth .lang-pill {
    padding: 0 12px;
  }
}