:root {
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--blue) 42%, transparent);
  outline-offset: 2px;
}

button,
a,
input,
select,
textarea {
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: .6;
}

.login {
  padding: 24px;
  overflow: auto;
  background: #f4f7fb !important;
}

.login-shell {
  width: min(980px, 100%);
  min-height: min(650px, calc(100vh - 48px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
  overflow: hidden;
  border: 1px solid #dfe6ef;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 24px 70px #1e345914;
}

.login-intro {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(34px, 6vw, 72px);
  color: #f8fbff;
  background: #15233b;
}

.login-intro h1 {
  max-width: 520px;
  margin: 12px 0 18px;
  font-size: clamp(36px, 5vw, 58px);
  line-height: 1.05;
  letter-spacing: -.035em;
}

.login-intro p:not(.login-eyebrow) {
  max-width: 460px;
  color: #cbd7e9;
  font-size: 17px;
}

.login-intro small {
  color: #9fb0c8;
}

.login-brand,
.login-card-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 17px;
  font-weight: 850;
}

.login-brand .brand-logo,
.login-card-brand .brand-logo {
  width: 38px;
  height: 38px;
}

.login-card-brand {
  display: none;
  margin-bottom: 32px;
  color: #17243a;
}

.login .login-card {
  width: auto;
  padding: clamp(34px, 5vw, 58px);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: #fff !important;
  color: #17243a;
}

.login .login-card h2 {
  margin: 7px 0 9px;
  font-size: 27px;
  letter-spacing: -.02em;
}

.login-eyebrow {
  margin: 0;
  color: #4776d0;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.login-intro .login-eyebrow {
  color: #91b9f0;
}

.login .login-card label {
  display: block;
  margin-top: 18px;
  font-size: 12px;
}

.login .login-card input {
  min-height: 48px;
  margin: 7px 0 0;
  border-color: #d8e0ea;
  background: #fff !important;
  color: #17243a !important;
}

.login .login-card input:focus {
  outline: 0;
  border-color: #6e9fdf;
  box-shadow: 0 0 0 4px #6e9fdf1f;
}

.login .login-card .btn {
  min-height: 46px;
  margin-top: 18px;
}

.login .login-card .auth-secondary {
  margin-top: 10px;
  background: #fff;
}

.auth-error {
  margin: 8px 2px 0;
  color: #c93645;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.auth-error.hidden {
  display: none;
}

html[data-theme="dark"] .auth-error {
  color: #ff8a96;
}

.login-links {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 18px;
  font-size: 12px;
  font-weight: 750;
}

.login-links a,
.auth-text-button {
  color: #3f70bf;
}

.auth-help {
  margin: 22px 0 0;
  font-size: 11px;
  text-align: center;
}

.auth-step .auth-back {
  color: #17243a;
  background: #fff;
}

.btn[aria-busy="true"] {
  position: relative;
  color: transparent !important;
}

.btn[aria-busy="true"]::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 17px;
  height: 17px;
  margin: -9px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  color: #fff;
  animation: nazoft-spin .7s linear infinite;
}

@keyframes nazoft-spin { to { transform: rotate(360deg); } }

html[data-theme="dark"] .login {
  background: #090d14 !important;
}

html[data-theme="dark"] .login-shell,
html[data-theme="dark"] .login .login-card,
html[data-theme="dark"] .login .login-card .auth-secondary,
html[data-theme="dark"] .login .login-card input,
html[data-theme="dark"] .auth-step .auth-back {
  background: #111820 !important;
  color: #eef3f8 !important;
  border-color: #2b3745;
}

html[data-theme="dark"] .login-intro {
  background: #05080d;
}

html[data-theme="dark"] .login-card-brand {
  color: #eef3f8;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: #8290a3;
}

.table-scroll {
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable;
}

.modal,
.drawer {
  overscroll-behavior: contain;
}

@media (max-width: 880px) {
  .login-shell {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .login-intro {
    display: none;
  }

  .login-card-brand {
    display: flex;
  }

  .head {
    align-items: flex-start;
    flex-direction: column;
  }

  .head .actions,
  .toolbar .push {
    width: 100%;
    margin-left: 0;
  }

  .toolbar {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .toolbar .search {
    flex-basis: 100%;
    max-width: none;
  }

  .user-row {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .user-row > :nth-child(n+3) {
    grid-column: 2;
  }
}

@media (max-width: 520px) {
  .login {
    place-items: start center;
    padding: 0;
    background: #fff !important;
  }

  .login-shell {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .login .login-card {
    padding: 28px 20px 34px;
  }

  .content {
    padding-inline: 14px;
  }

  .top {
    height: auto;
    min-height: 62px;
    flex-wrap: wrap;
    padding-block: 10px;
  }

  .top .search {
    order: 2;
    flex-basis: 100%;
    max-width: none;
  }

  .top-actions {
    width: 100%;
  }

  .top-actions .btn {
    flex: 1;
  }

  .metrics,
  .dashboard-metrics,
  .activity-grid,
  .security-grid,
  .permission-grid {
    grid-template-columns: 1fr !important;
  }

  .modal,
  .drawer {
    width: 100%;
    max-height: 100dvh;
    border-radius: 0;
  }

  .modal {
    inset: 0;
    transform: none;
  }

  .mobile button {
    min-width: 64px;
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
