html[data-auth-pending] body {
  visibility: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.auth-shell {
  position: relative;
  z-index: 1;
  width: min(520px, calc(100% - 36px));
  margin: 42px auto 72px;
}

.auth-heading {
  margin-bottom: 25px;
  text-align: center;
}

.auth-heading > span {
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.auth-heading h1 {
  margin: 10px 0 9px;
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.05em;
}

.auth-heading p {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.auth-card {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 70px rgba(44, 39, 82, 0.12);
}

html[data-login-theme="dark"] .auth-card {
  background: rgba(14, 18, 22, 0.96);
}

.auth-tabs,
.auth-role-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.auth-tabs {
  margin-bottom: 22px;
  padding: 4px;
  border-radius: 12px;
  background: var(--bg);
}

.auth-tabs button,
.auth-role-option {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font:
    750 0.78rem "Manrope",
    sans-serif;
  cursor: pointer;
}

.auth-tabs button.active {
  border-color: var(--line);
  color: var(--text);
  background: var(--panel);
  box-shadow: 0 5px 18px rgba(44, 39, 82, 0.08);
}

.auth-form,
.auth-register-fields,
.auth-reset-fields {
  display: grid;
  gap: 16px;
}

.auth-register-fields[hidden],
.auth-reset-fields[hidden],
.auth-tabs[hidden],
.auth-form > [hidden] {
  display: none;
}

.auth-form label,
.auth-role-group legend {
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 750;
}

.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"] {
  width: 100%;
  min-height: 48px;
  margin-top: 7px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  background: var(--panel);
  font:
    600 0.86rem "Manrope",
    sans-serif;
}

.auth-form input:focus-visible,
.auth-tabs button:focus-visible,
.auth-role-option:has(input:focus-visible) {
  outline: 3px solid rgba(109, 40, 217, 0.2);
  outline-offset: 2px;
  border-color: var(--accent);
}

.auth-role-group {
  min-width: 0;
  border: 0;
}

.auth-role-options {
  margin-top: 8px;
}

.auth-role-option {
  position: relative;
  display: grid;
  place-items: center;
  border-color: var(--line);
  background: var(--panel);
}

.auth-role-option:has(input:checked) {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(109, 40, 217, 0.07);
}

.auth-role-option input {
  position: absolute;
  opacity: 0;
}

.auth-submit {
  min-height: 49px;
  border: 0;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(135deg, #6d28d9, #8b5cf6);
  font:
    800 0.83rem "Manrope",
    sans-serif;
  cursor: pointer;
}

.auth-submit:disabled {
  cursor: wait;
  opacity: 0.62;
}

.auth-forgot,
.auth-back {
  justify-self: center;
  padding: 2px;
  border: 0;
  color: var(--accent);
  background: transparent;
  font:
    750 0.75rem "Manrope",
    sans-serif;
  cursor: pointer;
}

.auth-forgot {
  justify-self: end;
  margin-top: -8px;
}

.auth-forgot:hover,
.auth-back:hover {
  text-decoration: underline;
}

.auth-forgot:focus-visible,
.auth-back:focus-visible {
  outline: 3px solid rgba(109, 40, 217, 0.2);
  outline-offset: 3px;
  border-radius: 3px;
}

.auth-form[aria-busy="true"] .auth-forgot,
.auth-form[aria-busy="true"] .auth-back {
  pointer-events: none;
  opacity: 0.62;
}

.auth-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.5;
  text-align: center;
}

.auth-status[data-type="error"] {
  color: #c2414c;
}

.auth-status[data-type="success"] {
  color: #16834d;
}

.auth-note {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.55;
  text-align: center;
}

.auth-sign-out {
  width: 100%;
  margin-top: 8px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.68);
  background: rgba(255, 255, 255, 0.04);
  font:
    700 0.72rem "Manrope",
    sans-serif;
  cursor: pointer;
}

.auth-nav-sign-out {
  border: 0;
  font-family: inherit;
}

[data-auth-public-control] [hidden] {
  display: none;
}

.side-nav .auth-side-sign-out {
  position: relative;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-radius: 11px;
  color: inherit;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.side-nav .auth-side-sign-out:hover {
  background: rgba(255, 255, 255, 0.06);
}

.brand-side nav .auth-side-sign-out {
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 9px;
  color: var(--brand-muted);
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
}

.brand-side nav .auth-side-sign-out:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.side-nav .auth-side-sign-out:disabled,
.brand-side nav .auth-side-sign-out:disabled,
.auth-nav-sign-out:disabled {
  cursor: wait;
  opacity: 0.62;
}

.side-nav .auth-side-sign-out:focus-visible,
.brand-side nav .auth-side-sign-out:focus-visible,
.auth-nav-sign-out:focus-visible {
  outline: 3px solid rgba(109, 40, 217, 0.28);
  outline-offset: 2px;
}

@media (max-width: 560px) {
  .auth-shell {
    margin-top: 25px;
  }

  .auth-card {
    padding: 21px;
  }
}
