:root {
  color-scheme: dark;
  --auth-bg: #07080c;
  --auth-panel: rgba(21, 13, 18, 0.92);
  --auth-panel-strong: #1a1118;
  --auth-border: rgba(254, 44, 85, 0.22);
  --auth-text: #f7f7fa;
  --auth-muted: #9ea3b0;
  --auth-primary: #fe2c55;
  --auth-primary-dark: #c9153b;
  --auth-secondary: #25f4ee;
  --auth-danger: #ff7b87;
  --auth-warning: #ffc96b;
  --auth-shadow: 0 24px 70px rgba(0, 0, 0, 0.46), 0 0 60px rgba(254, 44, 85, 0.08);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

body.auth-page {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--auth-text);
  background:
    radial-gradient(circle at 14% 8%, rgba(254, 44, 85, 0.14), transparent 28rem),
    radial-gradient(circle at 90% 92%, rgba(37, 244, 238, 0.07), transparent 30rem),
    var(--auth-bg);
}

.auth-shell {
  width: min(1120px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 40px 0;
  display: grid;
  align-items: center;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.72fr);
  gap: 56px;
  align-items: center;
}

.auth-brand {
  max-width: 600px;
}

.auth-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  color: #ff6f8c;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-eyebrow::before {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--auth-primary);
  box-shadow: 0 0 0 5px rgba(254, 44, 85, 0.14);
  content: "";
}

.auth-brand h1 {
  margin: 0;
  font-size: clamp(42px, 6vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.05em;
}

.auth-brand h1 span {
  display: block;
  margin-top: 12px;
  color: var(--auth-primary);
}

.auth-motto {
  max-width: 520px;
  margin: 26px 0 0;
  color: var(--auth-secondary);
  font-size: 17px;
  line-height: 1.8;
}

.auth-values {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: 22px 0 0;
  color: var(--auth-secondary);
  font-size: clamp(12px, 3.5vw, 13px);
  font-weight: 650;
  letter-spacing: 0.08em;
  line-height: 1.7;
}

.auth-value {
  white-space: nowrap;
}

.auth-value:not(:last-child)::after {
  margin: 0 0.55em;
  color: var(--auth-secondary);
  font-weight: 800;
  content: "·";
}

.role-chip,
.status-chip {
  border: 1px solid var(--auth-border);
  border-radius: 999px;
  background: rgba(254, 44, 85, 0.04);
  color: #d9d4da;
  font-size: 13px;
}

.auth-card {
  border: 1px solid var(--auth-border);
  border-radius: 24px;
  padding: 32px;
  background: var(--auth-panel);
  box-shadow: var(--auth-shadow);
  backdrop-filter: blur(18px);
}

.auth-card h2 {
  margin: 0;
  font-size: 25px;
  letter-spacing: -0.02em;
}

.auth-card-lead {
  margin: 10px 0 26px;
  color: var(--auth-muted);
  font-size: 14px;
  line-height: 1.65;
}

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

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

.auth-field label,
.auth-fieldset legend {
  color: #dce7ef;
  font-size: 13px;
  font-weight: 650;
}

.auth-field input,
.auth-field select {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(160, 186, 210, 0.24);
  border-radius: 12px;
  outline: none;
  padding: 0 14px;
  color: var(--auth-text);
  background: rgba(8, 7, 11, 0.76);
  font: inherit;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.auth-field input:focus,
.auth-field select:focus {
  border-color: var(--auth-primary);
  box-shadow: 0 0 0 3px rgba(254, 44, 85, 0.17);
}

.auth-password-control {
  position: relative;
}

.auth-field .auth-password-control input {
  padding-right: 52px;
}

.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 5px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 0;
  border-radius: 9px;
  padding: 0;
  color: var(--auth-muted);
  background: transparent;
  cursor: pointer;
  transform: translateY(-50%);
}

.auth-password-toggle:hover {
  color: var(--auth-secondary);
  background: rgba(37, 244, 238, 0.08);
}

.auth-password-toggle:focus-visible {
  outline: 2px solid var(--auth-secondary);
  outline-offset: 1px;
}

.auth-password-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.auth-password-toggle .eye-closed,
.auth-password-toggle[aria-pressed="true"] .eye-open {
  display: none;
}

.auth-password-toggle[aria-pressed="true"] .eye-closed {
  display: block;
}

.auth-field small,
.auth-note {
  color: var(--auth-muted);
  font-size: 12px;
  line-height: 1.55;
}

.auth-form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.auth-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 32px;
  color: #dce7ef;
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
}

.auth-checkbox input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--auth-primary);
}

.auth-text-link {
  color: var(--auth-secondary);
  font-size: 13px;
  font-weight: 700;
  text-underline-offset: 3px;
}

.auth-text-link:hover {
  color: #8ffbf7;
}

.auth-form-help {
  margin: -10px 0 0;
  color: var(--auth-muted);
  font-size: 12px;
  line-height: 1.55;
}

.auth-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0 18px;
  cursor: pointer;
  color: #ffffff;
  background: var(--auth-primary);
  font: inherit;
  font-weight: 750;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  transition: filter 150ms ease, transform 150ms ease;
}

.auth-button:hover:not(:disabled) {
  filter: brightness(1.07);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(254, 44, 85, 0.2);
}

.auth-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.auth-button.secondary,
.auth-button.ghost {
  color: var(--auth-text);
  background: transparent;
  border-color: var(--auth-border);
}

.auth-button.danger {
  color: #ffdfe2;
  border-color: rgba(255, 123, 135, 0.4);
  background: rgba(255, 123, 135, 0.12);
}

.auth-button.compact {
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
}

.auth-message {
  display: none;
  border: 1px solid var(--auth-border);
  border-radius: 11px;
  padding: 11px 13px;
  color: #d8e5ee;
  background: rgba(255, 255, 255, 0.04);
  font-size: 13px;
  line-height: 1.5;
}

.auth-message.visible {
  display: block;
}

.auth-message.error {
  border-color: rgba(255, 123, 135, 0.42);
  color: #ffd4d8;
  background: rgba(255, 123, 135, 0.1);
}

.auth-message.warning {
  border-color: rgba(255, 201, 107, 0.42);
  color: #ffe3ae;
  background: rgba(255, 201, 107, 0.09);
}

.auth-message.success {
  border-color: rgba(37, 244, 238, 0.36);
  color: #bafcf8;
  background: rgba(37, 244, 238, 0.08);
}

.auth-footer-note {
  margin: 20px 0 0;
  color: #748ba0;
  font-size: 12px;
  text-align: center;
}

.management-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 30px 0 64px;
}

.management-header {
  display: grid;
  grid-template-columns: minmax(300px, 0.7fr) minmax(0, 1.3fr);
  gap: 20px;
  align-items: center;
  margin-bottom: 28px;
}

.management-header h1 {
  margin: 4px 0 0;
  font-size: 30px;
}

.management-header p {
  margin: 7px 0 0;
  color: var(--auth-muted);
}

.management-actions,
.user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.management-actions {
  width: max-content;
  max-width: 100%;
  justify-content: flex-end;
  justify-self: end;
}

.management-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.7fr) minmax(0, 1.3fr);
  gap: 22px;
  align-items: start;
}

.management-panel {
  border: 1px solid var(--auth-border);
  border-radius: 20px;
  padding: 24px;
  background: var(--auth-panel);
}

.management-panel h2 {
  margin: 0 0 6px;
  font-size: 19px;
}

.management-panel > p {
  margin: 0 0 22px;
  color: var(--auth-muted);
  font-size: 13px;
  line-height: 1.6;
}

.account-list {
  display: grid;
  gap: 12px;
}

.account-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  border: 1px solid var(--auth-border);
  border-radius: 15px;
  padding: 16px;
  background: rgba(8, 7, 11, 0.54);
}

.account-name {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.account-name strong {
  font-size: 15px;
}

.account-meta {
  margin-top: 7px;
  color: var(--auth-muted);
  font-size: 12px;
  line-height: 1.5;
}

.role-chip,
.status-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
}

.role-chip.admin {
  color: #ffe0a6;
  border-color: rgba(255, 201, 107, 0.3);
}

.status-chip.active {
  color: #9df4df;
  border-color: rgba(37, 244, 238, 0.3);
}

.status-chip.disabled {
  color: #ffbec4;
  border-color: rgba(255, 123, 135, 0.3);
}

.empty-state {
  border: 1px dashed var(--auth-border);
  border-radius: 14px;
  padding: 28px;
  color: var(--auth-muted);
  text-align: center;
}

.auth-dialog {
  width: min(440px, calc(100% - 30px));
  border: 1px solid var(--auth-border);
  border-radius: 18px;
  padding: 24px;
  color: var(--auth-text);
  background: var(--auth-panel-strong);
  box-shadow: var(--auth-shadow);
}

.auth-dialog::backdrop {
  background: rgba(7, 5, 9, 0.78);
  backdrop-filter: blur(4px);
}

.auth-dialog h2 {
  margin: 0 0 8px;
}

.auth-dialog p {
  margin: 0 0 18px;
  color: var(--auth-muted);
  line-height: 1.55;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 20px;
}

.hlj-session-nav {
  position: static;
  display: flex;
  width: max-content;
  max-width: 100%;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(254, 44, 85, 0.28);
  border-radius: 12px;
  padding: 8px;
  color: #eff8fb;
  background: rgba(12, 8, 12, 0.56);
  box-shadow: none;
  font: 12px/1.25 Inter, "PingFang SC", system-ui, sans-serif;
}

.hlj-session-nav a,
.hlj-session-nav button {
  border: 0;
  border-radius: 999px;
  padding: 7px 10px;
  cursor: pointer;
  color: #ffdce3;
  background: rgba(254, 44, 85, 0.13);
  font: inherit;
  text-decoration: none;
}

@media (max-width: 820px) {
  .auth-shell {
    padding: 28px 0;
  }

  .auth-layout,
  .management-grid {
    grid-template-columns: 1fr;
  }

  .auth-layout {
    gap: 32px;
  }

  .auth-brand h1 {
    font-size: 45px;
  }

  .management-header,
  .account-row {
    align-items: stretch;
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .management-actions {
    width: 100%;
    justify-content: flex-start;
    justify-self: stretch;
  }
}

@media (max-width: 520px) {
  .auth-card,
  .management-panel {
    padding: 21px;
  }

  .auth-motto {
    display: none;
  }

  .management-header {
    display: grid;
  }
}
