/* Existing homepage authentication dialog, retained for the new homepage. */
body.auth-modal-open {
  overflow: hidden;
}

.auth-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.76);
  padding: 0.72rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f172a;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.05);
  backdrop-filter: blur(12px);
}

.auth-status-chip::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 9999px;
  background: #10b981;
  box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.12);
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.auth-modal.is-open {
  display: flex;
}

.auth-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.36);
  backdrop-filter: blur(10px);
}

.auth-dialog {
  position: relative;
  width: 100%;
  max-width: 29rem;
  border-radius: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.92);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(242, 247, 255, 0.94));
  padding: 1.5rem;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.1);
}

.auth-close-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 9999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(241, 245, 249, 0.92));
  color: #475569;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 10px 20px rgba(15, 23, 42, 0.06);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease,
    color 180ms ease;
}

.auth-brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.78rem;
}

.auth-brand-emblem {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.78rem;
  height: 2.78rem;
  padding: 0.15rem;
  flex-shrink: 0;
  border-radius: 0.96rem;
  border: 1px solid rgba(96, 165, 250, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(239, 246, 255, 0.92));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 10px 24px rgba(37, 99, 235, 0.12);
}

.auth-brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 0.82rem;
  object-fit: cover;
}

  .auth-brand-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0;
    min-width: 0;
    overflow: hidden;
  }

  .auth-brand-title {
    display: block;
    margin: 0;
    font-family: "Segoe UI Variable Display", "PingFang SC", "Microsoft YaHei UI", sans-serif;
    font-size: 1.28rem;
    font-weight: 780;
    letter-spacing: 0;
    line-height: 1.04;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 58%, #2563eb 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }

.auth-brand-title--register {
  font-size: 0.96rem;
  letter-spacing: 0;
}

.auth-header-row {
  display: grid;
  gap: 0.85rem;
}

.auth-header-main {
  display: grid;
  gap: 0.85rem;
  min-width: 0;
}

.auth-header-topline {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.auth-header-topline .auth-brand-lockup {
  flex: 1 1 auto;
  min-width: 0;
}

.auth-header-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-shrink: 0;
}

.auth-close-button--header {
  margin-top: 0;
  flex-shrink: 0;
}

.auth-view-switch {
  display: inline-flex;
  gap: 0.4rem;
  padding: 0.35rem;
  border-radius: 9999px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(235, 241, 249, 0.92));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 12px 24px rgba(15, 23, 42, 0.07);
}

.auth-view-switch--header {
  gap: 0.22rem;
  padding: 0.18rem;
  margin-top: 0;
  flex-shrink: 0;
}

.auth-view-switch--header .auth-view-button {
  min-width: 3.72rem;
  padding: 0.46rem 0.72rem;
  font-size: 0.78rem;
}

.auth-view-button {
  border: none;
  background: transparent;
  border-radius: 9999px;
  min-width: 4.9rem;
  padding: 0.78rem 1.15rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  transition:
    transform 180ms ease,
    color 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease;
}

.auth-view-button:hover {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.52);
}

.auth-view-button.is-active {
  color: #155fdf;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(235, 244, 255, 0.94));
  box-shadow:
    inset 0 0 0 1px rgba(22, 119, 255, 0.14),
    0 12px 24px rgba(22, 119, 255, 0.16);
}

.auth-submode-switch {
  display: inline-flex;
  gap: 0.4rem;
  padding: 0.35rem;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.05);
}

.auth-submode-button {
  border: none;
  background: transparent;
  border-radius: 9999px;
  padding: 0.68rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  transition:
    color 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease;
}

.auth-submode-button.is-active {
  color: var(--blue);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.auth-demo-card {
  border-radius: 1.35rem;
  border: 1px solid rgba(22, 119, 255, 0.12);
  background: linear-gradient(180deg, rgba(240, 247, 255, 0.96), rgba(231, 241, 255, 0.92));
  padding: 1rem 1.05rem;
}

.auth-form {
  display: grid;
  gap: 1rem;
}

.auth-field {
  display: grid;
  gap: 0.45rem;
}

.auth-field label {
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f172a;
}

.auth-field-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 1rem;
}

.auth-field-meta--end {
  justify-content: flex-end;
}

.auth-input {
  width: 100%;
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(255, 255, 255, 0.9);
  padding: 0.95rem 1rem;
  font-size: 0.95rem;
  color: #0f172a;
  outline: none;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease;
}

.auth-input:focus {
  border-color: rgba(22, 119, 255, 0.42);
  box-shadow: 0 0 0 4px rgba(22, 119, 255, 0.1);
  background: #ffffff;
}

.auth-error {
  font-size: 0.85rem;
  line-height: 1.5;
  color: #dc2626;
}

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

.auth-helper-text {
  min-height: 1.1rem;
  font-size: 0.78rem;
  line-height: 1.5;
  color: #64748b;
}

.auth-inline-link {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  border: none;
  border-radius: 9999px;
  background: transparent;
  padding: 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--blue);
  cursor: pointer;
  transition:
    color 180ms ease,
    background-color 180ms ease;
}

.auth-inline-link:hover {
  background: rgba(22, 119, 255, 0.08);
  text-decoration: none;
}

.auth-submit-button {
  width: 100%;
  min-height: 3.35rem;
  letter-spacing: 0.01em;
}

.auth-code-button {
  min-width: 8.4rem;
  color: #1459c7;
  border-color: rgba(22, 119, 255, 0.16);
  background: linear-gradient(180deg, rgba(247, 251, 255, 0.98), rgba(235, 244, 255, 0.94));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 14px 28px rgba(22, 119, 255, 0.12);
}

.auth-code-button:hover {
  color: #0f56c5;
}

.primary-button:focus-visible,
.secondary-button:focus-visible,
.auth-view-button:focus-visible,
.auth-close-button:focus-visible,
.auth-inline-link:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 4px rgba(22, 119, 255, 0.14),
    0 14px 28px rgba(22, 119, 255, 0.12);
}

.auth-close-button:hover {
  transform: translateY(-1px);
  color: #0f172a;
}

.primary-button:disabled,
.secondary-button:disabled,
.auth-view-button:disabled,
.auth-close-button:disabled {
  cursor: not-allowed;
  transform: none;
  filter: saturate(0.88);
  opacity: 0.64;
  box-shadow: none;
}

.auth-toast {
  position: fixed;
  left: 50%;
  bottom: 1.6rem;
  z-index: 90;
  transform: translateX(-50%) translateY(1rem);
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.88);
  color: #ffffff;
  padding: 0.9rem 1.15rem;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.2);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 220ms ease,
    transform 220ms ease;
}

.auth-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 767px) {
  .auth-dialog {
    padding: 1.15rem;
  }

  .auth-brand-lockup {
    gap: 0.68rem;
  }

  .auth-brand-emblem {
    width: 2.42rem;
    height: 2.42rem;
    border-radius: 0.82rem;
  }

  .auth-brand-title {
    font-size: 1.12rem;
  }

  .auth-brand-title--register {
    font-size: 0.9rem;
  }

  .auth-header-row {
    gap: 0.72rem;
  }

  .auth-header-main {
    gap: 0.72rem;
  }

  .auth-header-topline {
    gap: 0.7rem;
  }

  .auth-header-actions {
    gap: 0.4rem;
  }

  .auth-view-switch--header {
    max-width: none;
  }

  .auth-view-switch--header .auth-view-button {
    min-width: 3.15rem;
    padding: 0.44rem 0.56rem;
    font-size: 0.74rem;
  }

  .auth-close-button--header {
    width: 2.35rem;
    height: 2.35rem;
  }

  .auth-code-button {
    width: 100%;
  }

  .auth-field-meta {
    justify-content: flex-start;
  }
}


.auth-submit-button { background: linear-gradient(135deg, #1677ff, #1459c7); }
.auth-dialog { max-height: calc(100dvh - 2.5rem); overflow-y: auto; }
